Candidate retrieval
BM25, dense and learned sparse models search the full collection.
Information Retrieval · Weeks 1–9 · Practicals · Projects
The course forms one connected Information Retrieval (IR) pipeline: index documents, retrieve candidates, rerank them, evaluate and learn from feedback, then provide evidence to a generator. Study sequence: retrieval → reranking → evaluation → RAG → attribution.
Place each weekly topic inside one software pipeline instead of memorising isolated functions.
corpus contains all documents; a query expresses a need; a run is the system ranking; and qrels are the reference relevance judgements. Evaluation compares a run with qrels.BM25, dense and learned sparse models search the full collection.
Rerankers and LTR models reorder a manageable candidate set.
Qrels support offline metrics; clicks require bias-aware online methods.
Understand how a search engine converts a large text collection into a structure that can be searched efficiently.
Database queries usually require exact matching and return deterministic answers. IR handles natural language and uncertain information needs, so it returns a ranked list. Relevance means whether a document satisfies a user's need in context, not merely whether it shares words with the query.
A corpus/collection is the full set of documents. A document is one record, a token is one occurrence produced by tokenisation, and a term is the normalised unit stored in the index.
tf occurrences in one document df documents containing the term cf total occurrences in the collection
A small number of terms are extremely frequent, while most terms are rare. Frequency falls approximately as a power law with rank.
This produces a long tail. Very frequent items are often function words; very rare items may be names, spelling variants, or noise.
A forward representation is document → terms. An inverted index stores term → postings list, allowing the engine to find candidate documents without scanning the entire corpus.
| Level | Posting contents | Supported capability |
|---|---|---|
| Boolean | docID | presence and AND / OR / NOT |
| Counts | docID + tf | TF, TF-IDF, and BM25 ranking |
| Positions | docID + tf + positions | phrase and proximity queries |
| Doc vectors | terms and statistics per document | custom scorers read tf/df; A1 requires -storeDocvectors |
df is not the total number of occurrences. A term appearing 20 times in one document contributes 1 to df but 20 to cf.index_reader.stats().Offline evaluation requires queries, qrels, and runs. Each measure represents a different user model.
Precision asks how clean the returned set is. Recall asks how much of the relevant set was found. Web results often emphasise early precision; legal and medical search may place more weight on recall.
F1 is the harmonic mean of precision and recall. β>1 emphasises recall; β<1 emphasises precision.
P@k contributes only when the item at rank k is relevant. Relevant documents that were never retrieved remain in |Rel|, reducing AP.
These measures care only about the first relevant answer, making them suitable for question answering and navigational search.
Graded relevance receives exponential gain and lower ranks receive a discount. IDCG is the score of the ideal ordering for the same query.
p is the probability that the user continues to the next result. Expected viewing depth is 1/(1-p).
Score the same queries with systems A and B, calculate one difference per query, then test whether the mean difference departs from zero.
p < .05 is commonly called significant; p < .01 strongly significant.
It is the probability of observing the current or a more extreme result if H₀ were true. It is not the probability that H₀ is true and does not measure effect size.
KeyError: ndcg_cut_5 normally means that measure was not requested when the evaluator was created.search(..., k=1000) creates a run → pytrec_eval.parse_run reads it → the evaluator scores each query → aggregation produces the mean → scipy.stats.ttest_rel compares paired query scores. Here k is the number of retrieved documents, not BM25's k1.Start with term presence, then add frequency, rarity, length normalisation, and probabilistic reasoning.
Course diagrams: open the course platform (login required)
| Model | Core idea | Score / role | Main limitation |
|---|---|---|---|
| Boolean | Satisfy logical conditions | AND / OR / NOT postings | Little or no ranking |
| Coordination | Match more distinct query terms | number of matched query terms | Ignores frequency and rarity |
| TF | More occurrences in a document are better | Σ f(qi,D) | Favours common terms and long documents |
| IDF | Rare terms are more discriminative | log(N/(1+dfi)) | Ignores within-document tf |
| TF-IDF | Local frequency × global rarity | Σ tfi,D × idfi | Linear tf and crude length treatment |
| VSM | Compare query and document vector directions | cosine(q,d) | Still depends on lexical overlap |
| BIM | Contrast term probability in relevant/non-relevant sets | probabilistic relevance weight | Term independence and probability estimates |
| BM25 | IDF + tf saturation + length normalisation | strong sparse baseline | No native synonym or semantic matching |
1 + df smooths the denominator. IDF depends on the term and collection, not on the current document.
A dot product is affected by vector magnitude. Cosine normalises magnitude and compares direction. For L2-normalised vectors, dot product and cosine produce the same ranking.
Several BM25 variants exist. In A1, follow the formula in the supplied notebook and marking sheet rather than mixing definitions.
tf_vector stores each query term's tf in the current document; df_vector stores each term's collection df; and doc_len is the current document length. The scorer returns one total score used to rank and write the run.assert score(tf=3) > score(tf=1) checks tf monotonicity; assert score(short_doc) > score(long_doc) checks length normalisation; and assert np.isfinite(...) catches NaN or infinity. A false condition raises AssertionError.Classical sparse models require lexical overlap. Transformers learn context-dependent representations that support semantic matching.
A tokenizer maps text to token IDs. nn.Embedding(V,D) is a trainable lookup table mapping each ID to a D-dimensional vector. D is a model hyperparameter; BERT-base uses 768.
The usual shape is N × D: N tokens, each represented by D values.
Self-attention alone does not encode order, so position embeddings are added. For sentence pairs, BERT uses segment/token-type embeddings and [SEP] boundaries.
## marks a continuation piece.QKᵀ produces an N×N score matrix.√d_k prevents large dot products from saturating softmax.Several heads learn relationships in different projection subspaces. Their outputs are concatenated and projected back to D dimensions.
The FFN transforms each token independently, often D→4D→D. hidden is an intermediate activation tensor, not a manually chosen parameter. The learned parameters are W and b. Residual connections preserve information; LayerNorm stabilises training.
An encoder can use left and right context, making it suitable for understanding, classification, ranking, and embeddings. BERT's main pretraining objective is masked language modelling.
A decoder uses a causal mask and sees only the left prefix, enabling token-by-token generation. An encoder backbone cannot naturally generate in the same way without an added decoder or modified objective and attention mask.
out = tf_block(x) is None, forward() or a called method is missing return x/return out. Python functions without return statements return None, so out.shape fails.Map queries and documents into a vector space where “car repair” can be close to “automobile maintenance.”
Course diagrams: open the course platform (login required)
Queries and documents are encoded separately. Document vectors can be precomputed and indexed for ANN search, making bi-encoders suitable for first-stage retrieval.
[query; document] is encoded jointly, allowing deep token interaction. This is accurate but prevents offline document encoding, so it is usually used to rerank a smaller candidate set.
For L2-normalised vectors, dot product and cosine rank identically. “Mean-pooling similarity” is imprecise: mean pooling aggregates a representation; it is not a similarity function.
The objective raises positive similarity relative to a set of negatives. A lower temperature τ makes softmax sharper. In-batch negatives reuse other queries' positive documents as negatives at little extra encoding cost.
A pair contributes zero loss once the positive score exceeds the negative score by at least the margin.
For each query token, find the most similar document token, then sum those maxima. This is not a single dot product between one query vector and one document vector.
Course diagrams: open the course platform (login required)
| Negative type | Source | Advantage | Risk |
|---|---|---|---|
| Random | random collection documents | cheap and stable | often too easy |
| In-batch | other positives in the batch | almost no extra encoding | false negatives |
| BM25 hard | high-ranked but judged non-relevant | lexically similar and challenging | depends on qrel completeness |
| ANN/self-mined | current model's mistaken neighbours | targets current weaknesses | costly index refresh |
smoke_query through TF and BM25, inspect top-5 output, and check the structure and finite scores. Formal conclusions still require all test queries and qrels.Vocabulary-aligned sparse representations retain inverted-index efficiency while neural models learn contextual term weights and expansion.
| Model | Query | Document | Matching | Online cost |
|---|---|---|---|---|
| BM25 | observed terms | term statistics | hand-crafted weighted sum | very low |
| DPR | dense vector | dense vector | dot product + ANN | query encoder |
| TILDEv2 | token IDs | contextual token weights, often expanded offline | exact ID match + max weight | no query encoder |
| SPLADE(v2) | learned sparse vocabulary vector | learned sparse vocabulary vector | sparse dot product | query encoder |
| PromptReps | dense hidden state + sparse logits | same | hybrid interpolation | LLM inference |
doc2query generates likely queries offline and appends them to documents before indexing. This reduces vocabulary mismatch without adding query-time generation.
The query is only tokenised. Exact query-token matches retrieve learned contextual document weights; repeated terms contribute their maximum weight.
An MLM head activates weighted vocabulary terms, including related terms absent from the text. ReLU, pooling and FLOPS/L1 regularisation control sparsity.
Sparse/dense describes the output representation. SPLADE uses BERT but emits a sparse vocabulary vector; DPR uses BERT but emits a dense embedding.
BM25 searches the full corpus.
Use hit IDs and raw document text.
TILDEv2 scores query-document pairs.
The first stage protects efficiency and candidate recall; the second stage improves ordering within the candidate set.
tildev2_scoringLTR learns to order candidates. Online LTR replaces scarce static labels with abundant but biased user interactions.
BM25, dense or learned sparse candidates.
Lexical, neural, freshness and authority signals.
Learned ordering of the candidate list.
Position bias changes examination; selection bias excludes unseen documents; presentation bias changes attraction. No click does not necessarily mean non-relevant.
IPS corrects position/exposure bias in expectation by dividing a click by its examination probability. Rarely examined observations receive more weight, which can also increase variance.
Maintain a scan pointer for each ranked list. Inspect the list with the smaller pointer, breaking ties with a randomly chosen starting ranker. Advance the pointer even for duplicates, but append only unseen documents. This balances inspected depths, not necessarily the number contributed by each ranker.
Sample a candidate parameter direction, compare current and candidate rankers through interleaving, and move toward the winner.
A stochastic logging policy records displayed actions and propensities. IPS then estimates the risk of current and candidate rankers from the same interaction log.
| Method | Data | Output | Main trade-off |
|---|---|---|---|
| Offline qrels | queries + runs + qrels | MAP/nDCG | cleaner but expensive and static |
| Interleaving | live clicks on a mixed list | pairwise preference | sensitive, but requires live exposure |
| DBGD | repeated interleaving | parameter update direction | online adaptation versus exploration risk |
| Counterfactual IPS | logged clicks + propensities | off-policy value/risk | log reuse versus variance and support assumptions |
Encoder rerankers jointly encode query-document pairs. Decoder-based Large Language Models (LLMs) judge, compare, or order passages through prompts. Stage one retrieves candidates; stage two makes more expensive, fine-grained relevance judgements.
BM25 searches the full collection and returns top-k candidates.
BERT jointly encodes pairs, or an LLM evaluates candidates through a prompt.
Sort by scores, pairwise preferences, or an output permutation.
A reranker cannot recover a relevant document omitted by Stage 1. Increasing candidate depth can protect recall but increases latency. Candidate depth connects effectiveness with efficiency.
Bidirectional Encoder Representations from Transformers (BERT) reads [CLS] query [SEP] document [SEP]. A classifier converts the contextual [CLS] vector into a relevance score.
Each document is judged independently. Training commonly uses human positives and BM25 hard negatives.
Binary cross-entropy rewards high positive scores and low negative scores. The output is a ranking signal, not necessarily a calibrated real-world probability.
| Method | Aggregation | Interpretation |
|---|---|---|
| BERT-FirstP | first passage score | cheap but ignores later evidence |
| BERT-MaxP | maximum passage score | one strong passage represents the document |
| BERT-SumP | sum of passage scores | accumulate evidence |
| Birch | first-stage score + weighted sentence scores | sentence-level evidence |
| PARADE | average, max, attention, or Transformer over passage vectors | representation aggregation |
duoBERT reads a query and two candidates to estimate p(dᵢ > dⱼ | q). Pairwise wins are then aggregated.
This can refine a monoBERT list, but pair comparisons add substantial encoder cost.
BM25 → monoBERT → duoBERT allows separate candidate depths and model choices. More tuning knobs create a wider effectiveness-efficiency trade-off space, but also more system complexity.
| Family | Input | Signal | Main trade-off |
|---|---|---|---|
| Pointwise | query + one passage | Yes/No logit, label, or grade | simple; absolute judgement may be unstable |
| Pairwise | query + passages A and B | A > B preference | robust; many comparisons |
| Listwise | query + passage list | generated permutation | list context; generation/context cost |
| Setwise | query + small passage set | best-item logits | fewer calls than pairwise; avoids full-list generation |
“Zero-shot” here means no new contrastive retriever training after obtaining an instruction-tuned LLM; it does not mean the underlying LLM was never trained.
Role text, formatting, output restrictions, and query/passage order affect results. The slides report greater sensitivity for pointwise and listwise prompts, while pairwise and setwise are generally more robust. Model size, architecture, and training still matter.
One call compares several passages using logits. This needs fewer comparisons than pairwise ranking and less generation than listwise permutation output.
Retrieve 10 or 20 candidates and read raw passage text.
Tokenise each pair, obtain relevant-class probability, and sort descending.
Write the reordered run and compare it with qrels.
The second exercise uses TinyLlama for pointwise Yes/No scores, then asks for a pairwise LLM prompt comparing two passages. Retrieval depth and evaluation cutoff are separate parameters.
LLM4IR uses Large Language Models for retrieval and ranking; IR4LLM supplies external evidence to an LLM. This week connects retrieval models to RAG, long context and attribution.
BM25, DPR, TILDEv2, SPLADE, CiC, or a specialist model selects evidence.
Rewrite, rerank, filter, fuse, summarise, or compress.
Answer from evidence and link claims to real sources.
Retrieval effectiveness and answer quality are related but different. Better nDCG can make good evidence available, yet prompt order, truncation, conflicting model knowledge, and evidence use still determine the answer.
Zero-shot gives instructions only; one/few-shot adds demonstrations; Chain-of-Thought (CoT) elicits intermediate reasoning tokens. Those tokens are generated text, not a guaranteed faithful trace of internal reasoning.
RepLLaMA and LLM2Vec generate dense representations. PromptReps and DiffRetriever explore multiple generated representations. Pointwise, pairwise, listwise, and setwise prompts produce ranking judgements.
| Dimension | LC-LLM / Corpus-in-Context | RAG |
|---|---|---|
| Input | very large corpus inside the prompt | small retrieved top-k |
| Benefit | consolidates a multi-stage pipeline | scales to large and changing collections |
| Cost | long-context attention and latency | retriever/reranker maintenance |
| Failure | position bias; lost-in-the-middle | missing, distracting, or conflicting evidence |
Corpus-in-Context (CiC, “seek”) uses consistent document IDs, corpus-grounded examples and a fixed list output. Prefix caching reduces repeated corpus-prefix work, but does not remove position bias.
Screenshot retrievers use a Vision-Language Model to preserve layout and visual evidence. DiffRetriever uses a diffusion language model to produce representative tokens in parallel and matches multiple representations.
External evidence can be newer, private, domain-specific, updateable and inspectable. Unlike further pretraining, the collection remains separate from the generator's parameters.
| Stage | Examples | Main risk |
|---|---|---|
| Pre-retrieval | routing, rewriting, expansion, HyDE | query drift |
| Retrieval | lexical, dense, learned sparse, hybrid | gold evidence absent from top-k |
| Post-retrieval | rerank, filter, fuse, summarise | latency or useful evidence removed |
| Prompt | lexical/embedding compression | lost qualifiers or provenance |
| Generation | read, cite, revise, retrieve again | model prior overrides evidence |
A rewriter makes an underspecified query search-friendly, a retriever selects evidence, and a reader answers. The rewriter can be warmed up with pseudo-data and later optimised from downstream reward.
Combine retrieval with model-generated query/answer signals, then use an LLM to filter irrelevant knowledge before generation. Retrieved results still require evidence selection.
Lexical methods delete low-information tokens; embedding methods map long text to compact memory tokens. Both save tokens but may lose evidence detail and provenance.
A model may ignore corrective evidence or change a correct answer after contrary evidence. Relevance, answer correctness and groundedness must be evaluated separately.
High-scoring distractors can sharply hurt answers; more distractors often worsen results; gold evidence in the middle can be underused; random context sometimes helps particular models. These are empirical model-dependent behaviours, not universal recipes.
Attribution links answer claims to supporting references. Directly generated citations may be fabricated; retrieval-based attribution restricts candidates to real documents.
Retrofit Attribution using Research and Revision researches support for an existing answer, then revises unsupported content while preserving as much of the draft as possible.
Identify the variables, then ask what each factor rewards or penalises.
| Name | Formula | Interpretation |
|---|---|---|
| P@k | relevant in top k / k | precision within cutoff k |
| Recall | retrieved relevant / all relevant | coverage of the relevant set |
| F1 | 2PR/(P+R) | harmonic mean of P and R |
| AP | (1/|Rel|) Σ P@k × rel(k) | record precision whenever a relevant result appears |
| MAP | mean(AP over queries) | each query has equal weight |
| RR | 1/rank(first relevant) | only the first relevant result matters |
| nDCG@K | DCG@K / IDCG@K | graded relevance plus position discount |
| RBP | (1-p)Σ r_i p^(i-1) | p models continuation probability |
| Name | Formula | Intuition |
|---|---|---|
| IDF | log(N/(1+df)) | rarer collection terms discriminate better |
| TF-IDF | Σ tf × idf | within-document importance × collection rarity |
| Cosine | q·d/(||q||||d||) | compare direction while reducing magnitude effects |
| BIM weight | log((N-df)/df) | probabilistic term advantage |
| BM25 | Σ IDF × saturated_tf(length-normalised) | rarity, saturation, and document length |
| Name | Formula | Intuition |
|---|---|---|
| Softmax | exp(z_i)/Σexp(z_j) | convert scores to weights summing to one |
| Attention | softmax(QKᵀ/√d_k)V | relevance-weighted value aggregation |
| InfoNCE | -log exp(s+)/[exp(s+)+Σexp(s-)] | classify the positive among candidates |
| Margin | max(0, m-(s+-s-)) | positive must lead by at least m |
| MaxSim | Σ_i max_j E_qi·E_dj | best document-token match for each query token |
| Autoregressive | Π_t P(y_t|y_<t) | predict the next token from the prefix |
| monoBERT | P(relevant=1|q,d) | pointwise score from joint encoding |
| Binary cross-entropy | -Σ_pos log(s)-Σ_neg log(1-s) | raise positives and suppress negatives |
| duoBERT | s(d_i)=Σ_{j≠i}p(d_i>d_j|q) | aggregate pairwise wins |
| Name | Formula | Interpretation |
|---|---|---|
| Naive clicks | Σ λ(rank_i)c_i | retains exposure bias |
| IPS | Σ [λ(rank_i)/P(o_i=1)]c_i | corrects examination bias in expectation |
| Off-policy weight | P(action|new)/P(action|logging) | reweights logged actions for a candidate policy |
| Counterfactual update | Risk_IPS(f) < Risk_IPS(f₀) | prefer lower estimated counterfactual risk |
For model questions, classify each claim by these components instead of memorising one sentence.
| Model | Representation / pooling | Similarity / interaction | Training | Role |
|---|---|---|---|---|
| BM25 | sparse term statistics | weighted sum over terms | usually untrained; tune k1,b | strong lexical baseline |
| TILDEv2 | query token IDs; contextual document-token weights | exact match + per-term max weight | document-side neural learning and expansion | fast learned sparse reranker |
| SPLADE(v2) | mostly-zero vocabulary vectors | sparse dot product | MLM head, distillation, sparsity regularisation | learned sparse retrieval |
| PromptReps | LLM dense state + sparse logits | normalised hybrid score | zero-shot | hybrid representation |
| DPR | CLS bi-encoder | dot product | InfoNCE/NLL; in-batch and hard negatives | first-stage dense retrieval |
| RepBERT | mean token embeddings | inner product | MultiLabelMarginLoss | BERT bi-encoder |
| ANCE | CLS / first token | dot product | NLL/InfoNCE-style; ANN self-mined negatives | dynamic hard-negative mining |
| Contriever | mean pooling | cosine | unsupervised contrastive; same-document spans | unsupervised dense retriever |
| ColBERT | all token embeddings | late-interaction MaxSim | contrastive / pairwise CE | efficient fine-grained matching |
| E5-Mistral | Mistral decoder; EOS/last token | temperature-scaled cosine | InfoNCE; synthetic and supervised data | LLM embedding model |
| LLM2Vec | decoder with bidirectional attention; pooling | often cosine | MNTP + unsupervised SimCSE + optional supervision | decoder converted to encoder |
| RepLLaMA | Llama2; EOS last hidden state | dot product | InfoNCE; supervision + LoRA | LLM retriever |
| Cross-encoder | joint query-document encoding | classification/regression relevance head | pointwise, pairwise, or listwise | high-accuracy reranker |
| monoBERT | [CLS] q [SEP] d [SEP] | relevant-class softmax score | binary cross-entropy; BM25 negatives | pointwise BERT reranker |
| BERT-MaxP / FirstP / SumP | document passages | max / first / sum passage score | transferred document labels | long-document score aggregation |
| PARADE | passage vectors | average / max / attention / Transformer aggregation | document-level ranking | representation aggregation |
| duoBERT | query + two documents | pairwise preference aggregation | pairwise cross-entropy | late-stage BERT reranker |
| LLM pointwise / pairwise | one document / document pair in a prompt | label logits / preference | zero-shot prompting | individual judgement / comparison |
| LLM listwise / setwise | candidate list / small set | permutation / best-item logits | zero-shot prompting | list context / efficient selection |
| Corpus-in-Context | whole corpus in an LC-LLM prompt | generated document IDs | few-shot prompting; no retriever training | small-corpus model-based retrieval |
| Screenshot retriever | page pixels and layout | VLM similarity | vision-language contrastive learning | layout-rich documents |
| DiffRetriever | parallel representative tokens | multi-representation matching | diffusion language model | generative multi-vector retrieval |
| Basic RAG | query + top-k evidence | autoregressive answer | retriever and generator may be frozen | evidence-based IR4LLM |
| Rewrite-Retrieve-Read | rewritten query + evidence | downstream answer reward | pseudo-data and optional policy optimisation | underspecified questions |
| BlendFilter | retrieved and model-generated knowledge | filter then generate | prompted LLM modules | remove distractors |
| RARR | draft + researched evidence | support check and revision | post-hoc research/revision | retrofit attribution |
Short name → full English name → definition. Model names that are not acronyms are identified separately.
| Short name | Full name | Definition |
|---|---|---|
| IR | Information Retrieval | Finding and ranking documents that satisfy an information need. |
| TF / DF / CF | Term Frequency / Document Frequency / Collection Frequency | Counts within one document, across documents containing the term, and across all term occurrences. |
| IDF | Inverse Document Frequency | A term's discriminative weight based on how few documents contain it. |
| TF-IDF | Term Frequency-Inverse Document Frequency | Combines local frequency with collection rarity. |
| VSM / BIM | Vector Space Model / Binary Independence Model | Vector similarity and probabilistic term-independence approaches to ranking. |
| BM25 | Best Matching 25 | A lexical model combining IDF, tf saturation, and length normalisation. |
| RSJ / F1 | Robertson-Spärck Jones / F-score with β = 1 | A probabilistic IDF weighting foundation for BM25, and the harmonic mean of precision and recall. |
| AP / MAP | Average Precision / Mean Average Precision | Average precision at relevant ranks for one query, then averaged across queries. |
| RR / MRR | Reciprocal Rank / Mean Reciprocal Rank | Measures where the first relevant result appears. |
| DCG / IDCG / nDCG | Discounted Cumulative Gain / Ideal DCG / Normalized DCG | Combines graded relevance and rank discount, then normalises by the ideal order. |
| RBP | Rank-Biased Precision | Models a user's probability of continuing down the ranking. |
| BERT | Bidirectional Encoder Representations from Transformers | An encoder model that can jointly contextualise query and document tokens. |
| CLS / SEP / EOS | Classification / Separator / End of Sequence token | Special tokens for classification summaries, segment boundaries, and sequence endings. |
| MLM / FFN | Masked Language Modeling / Feed-Forward Network | A masked-token pretraining objective and the per-token nonlinear sublayer in a Transformer block. |
| GPT / LLM | Generative Pre-trained Transformer / Large Language Model | Decoder-style generation family and the broader class of large pretrained language models. |
| DPR | Dense Passage Retrieval | A bi-encoder that retrieves by dense query-passage vector similarity. |
| ColBERT | Contextualized Late Interaction over BERT | Retains token vectors and applies MaxSim for fine-grained late interaction. |
| ANN / ANCE | Approximate Nearest Neighbour / Approximate Nearest Neighbor Negative Contrastive Estimation | Fast approximate vector search and a retriever that mines its ANN mistakes as hard negatives. |
| NLL / InfoNCE | Negative Log-Likelihood / Information Noise-Contrastive Estimation | Objectives that penalise low target probability and contrast positives against negatives. |
| CE | Cross-Entropy | A classification loss comparing target and predicted distributions. |
| TILDE | Term Independent Likelihood moDEl | Learns document-side vocabulary term likelihoods for efficient matching. |
| SPLADE | Sparse Lexical and Expansion Model | Learns sparse vocabulary weights and semantic expansion terms. |
| ReLU / FLOPS | Rectified Linear Unit / Floating-Point Operations | Produces non-negative activations, while the FLOPS-inspired regulariser discourages overly dense SPLADE vectors. |
| T5 | Text-to-Text Transfer Transformer | A sequence-to-sequence model that can generate offline doc2query expansions. |
| LTR / OLTR | Learning to Rank / Online Learning to Rank | Learns an ordering from labelled data or continuously from user interactions. |
| IPS | Inverse Propensity Scoring | Reweights observations by inverse exposure probability to correct bias in expectation. |
| DBGD | Dueling Bandit Gradient Descent | Uses interleaving outcomes to move toward a winning exploratory ranker. |
| COLTR | Counterfactual Online Learning to Rank | Evaluates candidate rankers off-policy using logged clicks and propensities. |
| RM3 / TREC | Relevance Model 3 / Text REtrieval Conference | A pseudo-relevance feedback model and a major standard IR evaluation programme. |
| Qrels | Query Relevance Judgements | Ground-truth query-document relevance labels used to evaluate a run. |
| MS MARCO / BEIR | Microsoft Machine Reading Comprehension / Benchmarking Information Retrieval | Widely used neural-ranking training data and a cross-domain retrieval benchmark suite. |
| JSONL | JSON Lines | Stores one independent JSON object per line for streaming datasets. |
| LoRA / MNTP / SimCSE | Low-Rank Adaptation / Masked Next Token Prediction / Simple Contrastive Learning of Sentence Embeddings | Efficient fine-tuning and representation-learning methods used by later embedding models. |
| PARADE | Passage Representation Aggregation for Document Reranking | Aggregates encoded passage vectors for long-document ranking. |
| LLM4IR / IR4LLM | Large Language Models for Information Retrieval / Information Retrieval for Large Language Models | Using LLMs to improve IR versus retrieving evidence to support an LLM. |
| monoBERT / duoBERT | Model names, not acronyms | Pointwise relevance scoring versus pairwise document preference. |
| RAG / LC-LLM | Retrieval-Augmented Generation / Long-Context Large Language Model | Retrieve a small evidence set for generation versus place much more source text directly in context. |
| CiC / CoT | Corpus-in-Context / Chain-of-Thought | Direct corpus prompting for retrieval and generated intermediate reasoning steps. |
| VLM / HyDE | Vision-Language Model / Hypothetical Document Embeddings | Models pixels and language; or retrieves by embedding a generated hypothetical answer document. |
| RARR | Retrofit Attribution using Research and Revision | Researches evidence for a draft and revises unsupported claims. |
| PPO | Proximal Policy Optimization | A reinforcement-learning method that can optimise a trainable query rewriter while limiting update size. |
A1 is not just a BM25 function. It is a reproducible IR experiment with validation, tuning, comparison, and analysis.
Train qrels select k1 and b. Test qrels are used once for unbiased final evaluation. Repeatedly changing parameters after inspecting test results leaks test information into training.
Do not write only “the score improved.” Explain how k1 changes tf saturation and b changes length normalisation, then use gain/loss queries to diagnose the effect.
# Clear scorer skeleton; adapt names to the supplied notebook
def bm25(tf_vector, df_vector, doc_len, k1=1.2, b=0.75):
score = 0.0
for tf, df in zip(tf_vector, df_vector):
idf = math.log(N / (1 + df))
norm = 1 - b + b * (doc_len / average_doc_length)
tf_weight = ((k1 + 1) * tf) / (tf + k1 * norm)
score += idf * tf_weight
return score
Answer first, then expand. Being able to explain why is the real test.
The guide synthesises the supplied INFS7410 folder. Large corpora, indexes, and virtual environments are experimental resources rather than revision content.
Review 44 topics through independent explanations and worked examples. Original course PDFs, slide screenshots and full slide transcripts are not distributed here.
Open revision Q/A · Original course materials (login required)