--- license: cc-by-4.0 pretty_name: AnswerReuse-Arena source_datasets: - lmarena-ai/arena-human-preference-140k tags: - semantic-cache - answer-reuse - benchmark - embeddings configs: - config_name: queries default: true data_files: - split: train path: benchmark/train.parquet - config_name: semantic_pairs data_files: - split: train path: benchmark/semantic_pairs.parquet --- # AnswerReuse-Arena AnswerReuse-Arena is the benchmark accompanying **Evaluating Semantic Caches by Answer Reusability and Net Token Savings**. It evaluates the distinction between semantically similar requests and requests that can reuse the same answer. It contains **42,580 distinct prompts** and **256,993 semantic query pairs**, together with frozen evaluation inputs and an optional construction supplement. The source is [Arena Human Preference 140K](https://huggingface.co/datasets/lmarena-ai/arena-human-preference-140k), released by the Arena team. This release preserves selected source answers, query/source mappings, embedding-based pair labels, and the inputs needed to inspect how the benchmark was built. **Pair labels are similarity proxies, not human judgments of answer correctness or reusability.** The companion AttrSC code is being prepared in the [`public-release` branch of the code repository](https://github.com/doctorjia/AttrHC/tree/public-release). This dataset release provides benchmark and preparation artifacts; it does not claim that final audited experimental results, human annotations, or every manuscript result bundle are included. Pin both the dataset revision and the corresponding code revision for an experiment. ## Quick start Install `datasets` and `huggingface_hub`, then load either table. Resolving the revision once ensures that both reads use the same repository snapshot: ```python from datasets import load_dataset from huggingface_hub import HfApi repo_id = "DoctorJia/AnswerReuse-Arena" revision = HfApi().dataset_info(repo_id).sha queries = load_dataset(repo_id, "queries", split="train", revision=revision) pairs = load_dataset(repo_id, "semantic_pairs", split="train", revision=revision) print(revision, len(queries), len(pairs)) # 42,580 queries; 256,993 pairs ``` The default configuration is `queries`. Each configuration explicitly selects its own Parquet file; the construction and paper tables have other schemas and are not mixed into either configuration. The Hugging Face split name `train` is a storage convention. **It is not the paper's calibration/test assignment**, which is recorded under `paper/`. ## Repository contents | Path | Contents | Use | | --- | --- | --- | | `benchmark/train.parquet` | Canonical query table with selected source answers | Benchmark requests | | `benchmark/semantic_pairs.parquet` | Query-pair endpoints, cosine scores, and proxy labels | Pair-level analysis | | `benchmark/dataset_manifest.json` | Original construction rules, counts, and checksums | Frozen benchmark provenance | | `paper/` | Eligibility, recovered context, source groups, reference answers, splits, replay orders, token baseline, protocol, and preparation manifests | Paper evaluation inputs | | `evaluation_embeddings/` | Frozen query vectors, text mapping, and manifest | Evaluation without regenerating embeddings | | `construction/embeddings/` | Full-source `queries.npy` and `answers.npy` | Construction and full-source similarity analysis | | `construction/canonical_source_row_ids.npy` | Exact-prompt canonical source rows | Figure 1 query universe | | `construction/figure1/` | Similarity-pair inputs for Figure 1 | Threshold and query/answer similarity analysis | | `construction/scan_manifest.json` | Scan rules and floating-point boundary validation | Figure 1 provenance | | `construction/source_qa/` | Cleaned QA table, cleaning report, and transformation documentation | Source-row interpretation and rebuilding | | `construction/provenance/` | Original embedding import and pair-mining manifests | Construction provenance | | `construction/reference_schema.parquet` | Zero-row compatibility schema | Rebuilding without a large historical schema-reference dataset | | `release_manifest.json` | Release file inventory, sizes, and SHA-256 hashes | File integrity | | `restore_map.json` | Released paths mapped to the code repository's expected local paths | Restoring experiment inputs | | `restore.py` | Hash-checked restoration helper that preserves different existing files | Restoring selected components | | `upstream_sources.json` | Pinned upstream repositories, revisions, and file identities | External input provenance | | `source_downloads.md` | Download instructions for external inputs | Raw Arena, tokenizer, and SemCache inputs | | `LICENSE.md` | Licensing scope and attribution | Applicable terms | The benchmark, paper inputs, and evaluation embeddings together occupy approximately **934 MB**. The two full-source vector matrices total approximately **4.96 GB**; the construction supplement also includes approximately **248 MB** of cleaned QA data and the smaller mapping, pair, and provenance files. Sizes use decimal units. Consult `release_manifest.json` for exact per-file sizes. The original approximately 12.1 GB Qdrant working database is not included; the portable NumPy matrices supply the released computation inputs. ### Download only the required components The following downloads the normal evaluation inputs without the multi-gigabyte construction supplement: ```python from huggingface_hub import HfApi, snapshot_download repo_id = "DoctorJia/AnswerReuse-Arena" revision = HfApi().dataset_info(repo_id).sha snapshot_download( repo_id=repo_id, repo_type="dataset", revision=revision, local_dir="answerreuse-arena", allow_patterns=[ "README.md", "LICENSE.md", "release_manifest.json", "restore_map.json", "upstream_sources.json", "source_downloads.md", "restore.py", "benchmark/*", "paper/*", "evaluation_embeddings/*", ], ) # Optional: construction and Figure 1 inputs at the same revision. snapshot_download( repo_id=repo_id, repo_type="dataset", revision=revision, local_dir="answerreuse-arena", allow_patterns=["construction/*"], ) ``` Keep the resolved commit SHA in your experiment record. Verify downloaded file sizes and SHA-256 hashes against `release_manifest.json`, and use `restore_map.json` when placing them in an AttrSC checkout. Raw original Arena shards, model/tokenizer files, and the SemCache datasets remain pinned upstream downloads; see [source_downloads.md](source_downloads.md) and [upstream_sources.json](upstream_sources.json). To verify and restore the downloaded files into an existing checkout: ```bash python answerreuse-arena/restore.py --target /path/to/AttrSC # After downloading construction/*, include the optional supplement: python answerreuse-arena/restore.py --target /path/to/AttrSC \ --components benchmark paper evaluation_embeddings construction ``` The helper verifies every selected file before copying and refuses to overwrite an existing file with different content. Use `--verify-only` to check downloaded inputs without copying. It restores repository-relative paths; it does not rewrite frozen absolute paths or registrations. ## Schema ### Query table: `benchmark/train.parquet` | Field | Type | Description | | --- | --- | --- | | `id` | int64 | Contiguous benchmark query identifier | | `prompt` | string | Exact query text, unique within this table | | `ID_Set` | int64 | Unique identifier per exact prompt; not an answer-equivalence class | | `dataset_name` | string | Historical dataset identifier retained in the frozen file | | `response_gpt-4.1-nano` | string | Selected Arena source answer, under a compatibility column name | | `source_row_id` | int64 | Canonical zero-based row of `construction/source_qa/train.parquet` | | `source_occurrence_count` | int32 | Retained source endpoints represented by the same exact prompt | | `semantic_neighbor_count` | int64 | Incident unique-query pairs after deduplication | | `equivalent_neighbor_count` | int64 | Incident pairs with `answer_sim >= 0.8` | | `non_equivalent_neighbor_count` | int64 | Incident pairs with `answer_sim < 0.8` | | `max_query_sim` | float32 | Maximum query similarity recorded during construction | `response_gpt-4.1-nano` does **not** mean that GPT-4.1 nano generated these answers. The answer is retained from the Arena source; its selected side and model can be traced through the cleaned source and paper preparation tables. Similarly, frozen manifests and `dataset_name` may retain `attrsc_LMArena` or `attrsc lm arena`. They refer to this benchmark's original artifact identity. These fields have not been renamed inside the frozen Parquet files. ### Pair table: `benchmark/semantic_pairs.parquet` | Field | Type | Description | | --- | --- | --- | | `pair_id` | int64 | Pair identifier | | `query_id_1`, `query_id_2` | int64 | Query identifiers in `benchmark/train.parquet` | | `source_row_id_1`, `source_row_id_2` | int64 | Canonical source-row identifiers | | `query_sim` | float32 | Query cosine similarity | | `answer_sim` | float32 | Selected-answer cosine similarity | | `is_equivalent` | bool | Whether `answer_sim >= 0.8`; an embedding proxy | There are **61,417** pairs satisfying the answer-similarity proxy and **195,576** pairs failing it. The table retains both groups; answer similarity is not an inclusion filter. ## Construction 1. Start from the frozen Arena source snapshot and extract **151,346 QA rows**. For a winning side, retain that side's answer; for a tie, retain side A; for `both_bad`, retain both sides as separate rows. Empty selected answers are omitted. For multi-turn conversations, extract the final non-empty user message preceding the selected final assistant answer. Details and omissions are recorded in `construction/source_qa/cleaning_report.json`. 2. Embed queries and selected answers with `qwen3-embedding:8b` and normalize the vectors. The full-source arrays each contain **151,346 × 4,096 float32 values**, aligned by zero-based cleaned-source row. The import manifest records a `chunk_mean_256_chars` fallback for non-finite embedding output. 3. Perform an exact blockwise query-similarity scan. Retain source pairs with **query cosine strictly greater than 0.8**, without an answer-similarity filter. The frozen scan contains 495,809 source-row pairs and 65,176 distinct source endpoints. 4. Deduplicate endpoints by exact prompt text. The lowest source row supplies the canonical answer. Remove resulting self-pairs and repeated query-pairs to obtain the 42,580 queries and 256,993 pairs. Compute `answer_sim >= 0.8` as the pair label. **11,597 retained queries have zero distinct-query neighbors** after deduplication: they qualified through a pair with an exact duplicate source prompt. They remain part of the frozen query universe; removing them would change the benchmark and the replay workload. The construction vectors are computation inputs exported as normalized float32 arrays. They do not preserve the internal serialization of the original Qdrant database. The historical import manifest records the embedding model tag and fallback strategy, but not a complete immutable record of the original serving stack and model weight digest. Reusing the released vectors reproduces that representation; rerunning a model by tag alone does not establish identical embeddings. ### Optional reconstruction After restoring the files using `restore_map.json` and installing the companion code's dependencies, a reconstruction can use the released arrays directly. Run from the AttrSC code repository root and use a fresh output directory: ```bash python scripts/build_attrsc_lmarena_dataset.py \ --reference data/AnswerReuse-Arena/reference_schema.parquet \ --query-vectors analysis/lmarena_query_answer_similarity_20261111/_vectors/queries.npy \ --answer-vectors analysis/lmarena_query_answer_similarity_20261111/_vectors/answers.npy \ --output data/AnswerReuse-Arena-rebuilt ``` The restored source table and import/mining manifests are also required. Both array arguments avoid reading the original Qdrant store. The zero-row reference contains only the compatibility schema; it does not redistribute historical reference-dataset examples. A new build may change timestamps, paths, naming, or Parquet serialization. Compare the documented semantic invariants and source identities, and retain the published files for experiments requiring their exact byte hashes. ### Figure 1 boundary convention The extended Figure 1 scan operates over **128,750 canonical exact prompts** from the full cleaned source. Its recomputed above-0.8 pair file contains **256,994** pairs: every frozen benchmark pair plus one floating-point boundary pair. The original strict block-matrix comparison and the extended scan's canonical float32 `einsum` scoring place that pair on different sides of the boundary. The source row IDs and scores are recorded in `construction/scan_manifest.json`. These files serve different recorded computations. The Figure 1 file does not replace `benchmark/semantic_pairs.parquet`, and its count is not a new benchmark version. ## Frozen paper inputs The prepared workload has **42,572 eligible requests**. Eight benchmark queries are excluded because required conversational context is unavailable. Requests are assigned by source groups, with split seed **20261105**: | Split | Requests | Source groups | Replay order seeds | | --- | ---: | ---: | --- | | Calibration | 8,542 | 7,347 | 142, 143, 144 | | Test | 34,030 | 29,388 | 42, 43, 44 | `paper/eligible_requests.parquet` includes the query, recovered context, source identity, eligibility, and split. `paper/reference_answers.parquet` supplies retained replay answers. `paper/baseline_tokens.parquet` and the protocol record token-accounting inputs. These are preparation artifacts, not measurements establishing cache accuracy or token savings. The evaluation vector array contains **42,580 × 4,096 float32 values**. Use its text mapping and `paper/embedding_rows.parquet` to resolve rows; do not assume that benchmark query IDs, vector row positions, source rows, and replay order positions are interchangeable. Original preparation manifests retain historical local paths to preserve their recorded identities. The current code's frozen-bundle verifier checks some absolute paths as well as file hashes. Relocating the files may require restoring recorded paths or preparing a new local bundle and registration with a new identity. Do not silently rewrite a manifest and report it as the unchanged frozen bundle. ## Interpretation and limitations - The benchmark selects semantically similar requests from real Arena conversations. It does not represent an unfiltered production request distribution. - A preferred source answer, a source `good`/`bad` label, and high embedding similarity each have different meanings. None alone establishes factual correctness or that a cached answer satisfies the current request and its conversational context. - Pair labels are computed from embeddings. Assessing the actual served answer requires the specified evaluation and audit procedure; this release does not relabel those proxies as completed human annotation. - The data retains source user text and generated responses, with their original errors and biases. The construction procedure is not a new content or privacy certification. - Prepared replay inputs, completed runs, judgments, independent audits, and final manuscript tables are separate artifacts. This repository releases the inputs described above, not a claim that all downstream experiments have been executed and audited. - SemCacheCombo is a separate supplementary workload. Its upstream snapshots and related source dependencies are listed in `upstream_sources.json`; they are not part of either AnswerReuse-Arena table configuration. ## Attribution and license Please attribute **AnswerReuse-Arena / the AttrSC authors**, identify this dataset repository and the exact revision used, acknowledge the [Arena source dataset](https://huggingface.co/datasets/lmarena-ai/arena-human-preference-140k), and describe any subsequent modifications. The accompanying manuscript is **Evaluating Semantic Caches by Answer Reusability and Net Token Savings**; this card does not assert a publication venue or acceptance status. The repository uses the Hugging Face license tag **`cc-by-4.0`**, with the following scope: - Arena user prompts retain their **Creative Commons Attribution 4.0 International** license. - Arena model answers remain subject to the respective model providers' terms of use, as stated in the [upstream license section](https://huggingface.co/datasets/lmarena-ai/arena-human-preference-140k#license). The repository tag does not override those terms. - Original selection, annotations, and metadata contributed by the AttrSC authors are offered under **CC BY 4.0**, to the extent the authors hold the applicable rights. Derived files do not relicense underlying third-party content. See [LICENSE.md](LICENSE.md) for the licensing scope and [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) for the license. The companion source code has its own license; it does not determine the license of conversation content, model outputs, or external datasets.