Decoder. plain-English AI glossary

Scoring function

● Core

A formula that ranks documents by how likely they are to answer the question.

Think of it like

Like a bouncer at a bar — you ask "Is this person relevant?" and the function returns a score instead of yes/no.

Example

A BM25 scoring function looks at word frequency and document length. A learned ranker might use a neural network trained on click data. Both output a number — higher means "more relevant."

How it actually works

Scoring functions sit between retrieval and ranking. Simple ones (BM25, TF-IDF) are keyword-based and fast. Learned ones (LambdaMART, neural rankers) are expensive but accurate. The catch: your training data shapes what "relevant" means, so garbage labels in training produce garbage scores at inference.

For product teams

A better scoring function can mean the difference between users finding answers on page one vs. page five.

For engineers

Implement as a function(query, doc) → score, where score is a real number. Train on relevance labels if building a learned ranker.

Related

Read anything AI without the jargon

Look up any term in plain English, or save terms as you read with the free Chrome extension.

Open DecoderAdd to Chrome