Skip to content
AnswerWell geo Documentation

Answerwell tools · 3 min read · Answerwell

Search Algorithm Reconstruction

Reconstructing search algorithms: crawl models, retrieval, learning to rank, identifiability and checking similarity of results.

Reconstructing a search system means building a model that reproduces the observed properties of crawling, indexing or ranking. Patents, papers, documentation, code and experimental observations set hypotheses about the architecture. They do not uniquely determine the production weights currently in use or all the internal constraints of an external service.

Subsystem Input Observed behaviour
Crawling URLs, links, change history Which URL is chosen and when it is fetched again
Indexing HTML, resources, duplicates Whether the document is available to search
Retrieval Query and index The candidate set
Ranking Candidates and context Order and composition of the results
Generative answer Query and retrieved evidence Text, facts and citations

The decomposition makes it possible to localize an error. A document missing from the candidates cannot be lifted by replacing the final ranker alone. Comparisons of results must account for region, language, device and time.

BM25 is a transparent lexical baseline [1]. PageRank describes how weight spreads through the link graph [2]:

π=αP⊤π+(1−α)v.\pi=\alpha P^\top\pi+(1-\alpha)v.

PP is the matrix of transitions between pages with dangling nodes handled, vv the teleportation distribution, and 0<α<10<\alpha<1. This historical model is useful for studying graphs, but it is not the full formula of a modern search engine.

In learning to rank, pairwise preferences can be learned with a logistic loss:

L=∑(q,i,j)log⁡(1+exp⁡[−σ(s(q,di)−s(q,dj))]),\mathcal L=\sum_{(q,i,j)}\log\left(1+\exp[-\sigma(s(q,d_i)-s(q,d_j))]\right),

where did_i is preferred to djd_j and σ>0\sigma>0 sets the scale. RankNet and LambdaMART tie training to the task of ordering documents [3]. The source of the preference matters: expert relevance, clicks and the order of an external system represent different targets.

A document in the first position gets noticed more often. Training directly on clicks mixes quality with the probability of being seen. Inverse propensity weighting corrects some of these biases [4], provided the observation probabilities are estimated soundly and are not zero. Very small probabilities create high variance; clipping the weights reduces it at the cost of bias.

For expert relevance, NDCG is used:

DCG@k=∑i=1k2reli−1log⁡2(i+1),NDCG@k=DCG@kIDCG@k.DCG@k=\sum_{i=1}^k\frac{2^{rel_i}-1}{\log_2(i+1)},\qquad NDCG@k=\frac{DCG@k}{IDCG@k}.

IDCGIDCG is the result of an ideal sort of the same judgements; the case of a zero denominator is stated explicitly. Agreement with the external results is assessed separately: top-k overlap, rank correlation on the shared set, errors by query type. A model may faithfully repeat someone else’s errors, or give more relevant answers in a different order.

A finite set of observations is usually compatible with many architectures and parameter sets. So a high score on a control panel confirms behavioural closeness within that panel. It does not prove that the source code, all the weights or hidden sources have been recovered.

The corpus is split by time, domain and topic group. Ablations are run: link features are removed, embeddings are swapped, the crawl strategy is changed. Robustness to new pages and to a shift in language is tested. Predictions about the effect of changes are then compared with experiments on the site, keeping the distinction between a simulation and a causal result.

Reproducibility and how Answerwell applies it

Section titled “Reproducibility and how Answerwell applies it”

In the project’s research loop, Answerwell’s own robots and ML/DL models are applied to brand data. The grounds for each architecture, corpus versions, training parameters and compute are recorded according to the general methodology. Public, acquired and internal data each keep their own provenance; describing a method does not mean a proven match with the closed weights of an external platform.

The test set is separated from training by time and by object. Raw observations, failed attempts and unknown values are kept. Models are compared on the same data and budget, with the sample size and errors by segment reported. Illustrative calculations in this article are not a claim about an experiment Answerwell has carried out.

  1. Robertson S., Zaragoza H. (2009). The Probabilistic Relevance Framework: BM25 and Beyond.
  2. Page L., Brin S., Motwani R., Winograd T. (1999). The PageRank Citation Ranking.
  3. Burges C. (2010). From RankNet to LambdaRank to LambdaMART.
  4. Joachims T., Swaminathan A., Schnabel T. (2017). Unbiased Learning-to-Rank with Biased Feedback.