Skip to content
Back to skills

Calibrated Similarity

ASecurity

Measures the semantic novelty of LLM-generated text by quantifying its similarity to the closest segment in the model's pretraining corpus. It probes whether models merely reproduce memorized training data or generalize to produce compositionally distinct outputs. Use when the user has predictions and gold and needs to compute calibrated similarity.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 11, 2026
ai-agentspythongo

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add qhjqhj00/research-skills-pool --skill calibrated-similarity --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Calibrated Similarity?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Calibrated Similarity
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qhjqhj00-calibrated-similarity/badge)](https://www.skillsdirectory.com/skills/qhjqhj00-calibrated-similarity)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: calibrated-similarity
description: Measures the semantic novelty of LLM-generated text by quantifying its similarity to the closest segment in the model's pretraining corpus. It probes whether models merely reproduce memorized training data or generalize to produce compositionally distinct outputs. Use when the user has predictions and gold and needs to compute calibrated similarity.
metadata:
  skill_kind: metric
  source_arxiv: 2510.27313
  bibtex_key: davydov2025llm
  confidence: high
---

# calibrated-similarity

> LLM generation novelty through the lens of semantic similarity — Davydov et al. (2025) (arXiv:2510.27313, 2025)

## What this evaluates

Measures the semantic novelty of LLM-generated text by quantifying its similarity to the closest segment in the model's pretraining corpus. It probes whether models merely reproduce memorized training data or generalize to produce compositionally distinct outputs.

## Datasets

- **Dolma (Reddit & Pes2o subsets)** — total 1210; splits: test (1210)
- **GSM8K** — total ?; splits: test (-1)
- **TruthfulQA** — total ?; splits: test (-1)
- **OpenRewriteEval** — total ?; splits: test (-1)

## Metrics

- `calibrated similarity` **(primary)** — range: [0, 1]
  - Computes the maximum semantic similarity between a generated text and any chunk in the pretraining corpus using a two-stage retrieval pipeline (GIST embeddings for coarse retrieval, ColBERTv2 for re-ranking). Scores are calibrated to account for generation length variations.

## Input / output format

**Input**: For open-ended generation: empty string or neutral instruction. For prompted generation: 1000-token context window from a source document. For domain tasks: standard prompts from GSM8K, TruthfulQA, and OpenRewriteEval.

**Output**: Generated text continuation or answer.

## Scoring recipe

```python
def compute_novelty(model, input_text, corpus_chunks, gold_answer):
    gen = model.generate(input_text)
    # Stage 1: Coarse retrieval with GIST embeddings
    candidates = faiss_search(gist_embed(gen), topk=100)
    # Stage 2: Re-ranking with ColBERTv2
    best_chunk = colbertv2_rerank(gen, candidates)[0]
    # Compute raw similarity
    raw_sim = colbertv2_score(gen, best_chunk)
    # Filter for correctness (domain-specific)
    if not is_correct(gen, gold_answer): return None
    # Calibrate for length and return
    return calibrate_similarity(raw_sim, len(gen))
```

## Common pitfalls

- Conflating novelty with hallucination: nonsensical outputs are trivially novel because they do not match training data, so correctness filtering is mandatory.
- Ignoring generation length effects: similarity scores vary systematically with output length, requiring analysis across multiple chunk sizes (k ∈ {50, 100, ..., 500}).
- Relying on lexical matching: surface-level paraphrasing or stylistic shifts can hide high semantic similarity, necessitating token-level late-interaction (ColBERTv2).

## Evidence (verbatim from paper)

> Figure[2] shows that models prompted without context (right plots) achieve higher calibrated similarity scores across chunk sizes than context-conditioned generations (left plots), for both SmolLM and SmolLM2.

## Citation

```bibtex
@misc{davydov2025llm,
  title={LLM generation novelty through the lens of semantic similarity},
  author={Davydov et al. (2025)},
  year={2025},
  note={arXiv:2510.27313}
}
```

- arXiv: 2510.27313

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.