On Christmas Day 2019 I added 14 lines to an evaluation script, and a model’s score went from 0.52 to 0.59
Published:
On Christmas Day 2019 I added 14 lines to an evaluation script, and a model's score went from 0.52 to 0.59.
I hadn't retrained anything. The script had been looking words up in a form the model never saw.
The repository held Portuguese word embeddings. Its evaluation script scored them on ASSIN, a sentence similarity benchmark, by looking up each word exactly as it appeared in the sentence.
The embeddings had been trained on text that went through a cleaning function first. The evaluation never called it. Each miss was swapped for 'unk', and the similarity was computed over that.
I ran the same cleaning on both sentences before the lookup. That 0.52 was the Pearson correlation of FastText skip-gram with 1000 dimensions, and its MSE dropped from 0.59 to 0.50 too. Every other embedding evaluated went up or stayed where it was. The maintainer merged it the same day and called it a severe bug in the evaluation procedure.
I documented the fix in a paper, "Portuguese Language Models and Word Embeddings: Evaluating on Semantic Similarity Tasks", which was peer reviewed, published and presented at PROPOR 2020 in Évora, Portugal.
Language model evals break the same way. What I'd carry from that script into an LLM project:
• Give the eval exactly what training gave the model, down to the chat template, the system prompt and the text cleaning. In RAG, normalise the query the way you normalised the documents before indexing them.
• Count every silent fallback: unknown tokens, truncated prompts, empty retrievals, answers your parser couldn't read. That script swapped in 'unk' and carried on, and nothing it printed said how often.
• When a score looks low, read twenty inputs as the model receives them before you change the model.
• When you fix an eval, keep the old behaviour runnable. I left it as the default, with the fix behind clean=True, so the numbers the embeddings were first published with can still be reproduced.
What's the smallest harness fix that moved one of your scores?

Originally posted on LinkedIn.