PreTTR Precomputing Transformer Term Representations
Architectures AIMech:PreTTRPrecomputingTermRepresentationsForReranking DRAFT
Aliases: PreTTR, Precomputing Transformer Term Representations, PreTTR Split-Layer Transformer Re-Ranking
A decoupled-layer Transformer document re-ranking architecture and token-representation compression method that applies a cross-segment attention mask in the first l layers L_1, ..., L_l of an n-layer Transformer during training—preventing query tokens ([CLS]; q; [SEP]) from attending to document tokens (d; [SEP]) and vice versa—so that layer-l document token representations s_l in R^{m x d} can be precomputed offline at index time, compressed to dimension e < d via a GELU bottleneck encoder-decoder pre-trained to minimize mean squared error on the attention score matrices of the remaining n - l layers, and concatenated at query time with the layer-l query representations to execute only layers L_{l+1}, ..., L_n (computing only the [CLS] token in the final layer L_n).
Identity Notes & Concept Scope
Distinct from ColBERT (AIMech:ColBERTContextualizedLateInteraction), which encodes queries and documents completely independently through all Transformer layers and interacts only via a parameter-free sum-of-MaxSim dot-product operator at the output; and distinct from standard cross-encoder Transformer distillation (such as TinyBERT or DistilBERT), which reduces total layer count for both query and document at query time rather than precomputing the first l document layers at index time and executing only the upper n - l interaction layers online.
Claims & Grounded Evidence
4 Claims
Mechanism
#prettr-lower-layer-cross-segment-attention-masking-and-split-execution
PreTTR masks cross-segment attention in layers L_1, ..., L_l so query tokens ([CLS]; q; [SEP]) and document tokens (d; [SEP]) attend only within their own segments, while removing the mask in layers L_{l+1}, ..., L_n (Section 4.1, Figures 1-2): this makes index-time document encoding through layers 1..l mathematically independent of the query, reduces query-time Transformer layer traversal cost by approximately (n - l) / n, and further accelerates layer L_n by computing only the [CLS] output representation used by W_combine (Equation 1 & Section 6.3).
Mechanism
#prettr-gelu-token-compression-with-upper-layer-attention-mse-loss
To compress the layer-l token representations s_l in R^{m x d} before disk storage, PreTTR inserts a bottleneck encoder r = GELU(s_l W_comp + b_comp) in R^{m x e} (e < d) and linear batch-normalized decoder s_hat_l in R^{m x d} between layers L_l and L_{l+1}, pre-training the compression parameters on unlabeled text to minimize the average mean squared error of the upper-layer attention score tensors L(a_{l+1}, ..., a_n, a_hat_{l+1}, ..., a_hat_n) = (1 / (n - l)) * sum_{i=l+1}^n MSE(a_i, a_hat_i) (Equation 2) prior to end-to-end relevance fine-tuning (Section 4.2).
Application
#prettr-webtrack-and-robust04-speedup-and-storage-reduction-application
On TREC WebTrack 2012 and TREC Robust 2004, PreTTR accelerates Vanilla BERT top-100 document re-ranking by up to 42.2x at l = 11 on WebTrack (0.046s vs. 1.941s per query with no statistically significant loss in P@20: 0.3380 vs. 0.3460, Tables 3 & 5) and 9.2x at l = 10 on Robust04 (0.266s vs. 2.437s), generalizes to RoBERTa (up to 56.3x speedup) and DistilBERT (up to 24.1x speedup, Table 6), and reduces ClueWeb09-B token storage by up to 97.5% (from 112 TB to 2.8 TB) when combining spam filtering, e = 128 compression, and 16-bit floats (Section 6.2, p. 7).
Limitation
#prettr-per-token-storage-footprint-and-high-layer-graded-relevance-limitation
Even with e = 128 compression and 16-bit floating-point storage, storing per-token representations for web-scale corpora requires multiple terabytes (2.8 TB on ClueWeb09-B and 195 GB at e = 256 on Robust04, Section 6.2), and deferring query-document interaction until the final layer (l = 11) significantly degrades graded relevance metrics (ERR@20 on WebTrack and both P@20 and nDCG@20 on longer Robust04 queries, Table 3 & Section 6.4).
⚠️ Curated Limitations & Negative Results
- Requires storing compressed contextualized vectors for every token of every document in the corpus (e.g., 195 GB for Robust04 at e = 256 and 2.8 TB for ClueWeb09-B at e = 128 with fp16).
- Precomputing up to the penultimate layer (l = 11 in a 12-layer BERT) degrades graded relevance metrics (ERR@20 and nDCG@20) and fails on longer, more qualified queries such as TREC Robust 2004.
Artificial Intelligence Ontology (AIO) Grounding
Mapped AIO Classes
| AIO Target Class | Mapping Relation | Mapping Rationale |
|---|---|---|
AIO:ArtificialNeuralNetwork
Artificial Neural Network
|
related_match | PreTTR modifies deep Transformer neural networks (BERT, RoBERTa, DistilBERT) with lower-layer cross-segment attention masking and a GELU token-compression bottleneck. |
Evidence Sources & Primary Literature
3 Sources| Source ID | Publication / Document | Type / Access | Reference & Checksum |
|---|---|---|---|
r780-primary-pdf
|
Sean MacAvaney, Franco Maria Nardini, Raffaele Perego, Nicola Tonellotto, Nazli Goharian, Ophir Frieder
|
primary paper
full_text
|
ID: https://arxiv.org/bibtex/2004.14255
sha256:f40c8c78c996…
|
r780-arxiv-abs
|
Efficient Document Re-Ranking for Transformers by Precomputing Term Representations (arXiv abstract)
Sean MacAvaney, Franco Maria Nardini, Raffaele Perego, Nicola Tonellotto, Nazli Goharian, Ophir Frieder
|
primary paper
abstract_only
|
ID: https://arxiv.org/abs/2004.14255
sha256:dd4eea1a6a58…
|
r780-metadata-cr
|
Sean MacAvaney, Franco Maria Nardini, Raffaele Perego, Nicola Tonellotto, Nazli Goharian, Ophir Frieder
|
primary paper
abstract_only
|
ID: https://arxiv.org/bibtex/2004.14255
sha256:dbcfff32f4f4…
|
Ontology & Grounding Topology
Open in interactive network graph →Curation Provenance
Curator: Antigravity
Method: ai_assisted
Model: Gemini
Created: 2026-10-19T14:23:00Z
Updated: 2026-10-19T14:23:00Z
Source File:
data/curated/PreTTRPrecomputingTermRepresentationsForReranking.yaml
· Schema:
curated_concept.yaml
Explore across X-Mech
Related computational & biological Mechs:
Embedding Map
Network Graph
ProteinTraitsMech (ESM-2 pLM)
DUFMech (Domain pLM)
TraitMech
CultureMech
All 14 X-Mech Repositories