| --- |
| configs: |
| - config_name: corpus |
| data_files: |
| - split: NanoCodeRAGLibraryDocumentationSolutions |
| path: corpus/NanoCodeRAGLibraryDocumentationSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGOnlineTutorials |
| path: corpus/NanoCodeRAGOnlineTutorials-00000-of-00001.parquet |
| - split: NanoCodeRAGProgrammingSolutions |
| path: corpus/NanoCodeRAGProgrammingSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGStackoverflowPosts |
| path: corpus/NanoCodeRAGStackoverflowPosts-00000-of-00001.parquet |
| - config_name: queries |
| data_files: |
| - split: NanoCodeRAGLibraryDocumentationSolutions |
| path: queries/NanoCodeRAGLibraryDocumentationSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGOnlineTutorials |
| path: queries/NanoCodeRAGOnlineTutorials-00000-of-00001.parquet |
| - split: NanoCodeRAGProgrammingSolutions |
| path: queries/NanoCodeRAGProgrammingSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGStackoverflowPosts |
| path: queries/NanoCodeRAGStackoverflowPosts-00000-of-00001.parquet |
| default: true |
| - config_name: qrels |
| data_files: |
| - split: NanoCodeRAGLibraryDocumentationSolutions |
| path: qrels/NanoCodeRAGLibraryDocumentationSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGOnlineTutorials |
| path: qrels/NanoCodeRAGOnlineTutorials-00000-of-00001.parquet |
| - split: NanoCodeRAGProgrammingSolutions |
| path: qrels/NanoCodeRAGProgrammingSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGStackoverflowPosts |
| path: qrels/NanoCodeRAGStackoverflowPosts-00000-of-00001.parquet |
| - config_name: bm25 |
| data_files: |
| - split: NanoCodeRAGLibraryDocumentationSolutions |
| path: bm25/NanoCodeRAGLibraryDocumentationSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGOnlineTutorials |
| path: bm25/NanoCodeRAGOnlineTutorials-00000-of-00001.parquet |
| - split: NanoCodeRAGProgrammingSolutions |
| path: bm25/NanoCodeRAGProgrammingSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGStackoverflowPosts |
| path: bm25/NanoCodeRAGStackoverflowPosts-00000-of-00001.parquet |
| - config_name: harrier_oss_v1_270m |
| data_files: |
| - split: NanoCodeRAGLibraryDocumentationSolutions |
| path: harrier_oss_v1_270m/NanoCodeRAGLibraryDocumentationSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGOnlineTutorials |
| path: harrier_oss_v1_270m/NanoCodeRAGOnlineTutorials-00000-of-00001.parquet |
| - split: NanoCodeRAGProgrammingSolutions |
| path: harrier_oss_v1_270m/NanoCodeRAGProgrammingSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGStackoverflowPosts |
| path: harrier_oss_v1_270m/NanoCodeRAGStackoverflowPosts-00000-of-00001.parquet |
| - config_name: reranking_hybrid |
| data_files: |
| - split: NanoCodeRAGLibraryDocumentationSolutions |
| path: reranking_hybrid/NanoCodeRAGLibraryDocumentationSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGOnlineTutorials |
| path: reranking_hybrid/NanoCodeRAGOnlineTutorials-00000-of-00001.parquet |
| - split: NanoCodeRAGProgrammingSolutions |
| path: reranking_hybrid/NanoCodeRAGProgrammingSolutions-00000-of-00001.parquet |
| - split: NanoCodeRAGStackoverflowPosts |
| path: reranking_hybrid/NanoCodeRAGStackoverflowPosts-00000-of-00001.parquet |
| language: |
| - code |
| tags: |
| - information-retrieval |
| - retrieval |
| - nano |
| - bm25 |
| - dense-retrieval |
| - reranking |
| - hakari-bench |
| dataset_info: |
| - config_name: bm25 |
| features: |
| - name: query-id |
| dtype: string |
| - name: corpus-ids |
| list: string |
| splits: |
| - name: NanoCodeRAGLibraryDocumentationSolutions |
| num_bytes: 1180757 |
| num_examples: 200 |
| - name: NanoCodeRAGOnlineTutorials |
| num_bytes: 1191012 |
| num_examples: 200 |
| - name: NanoCodeRAGProgrammingSolutions |
| num_bytes: 1110671 |
| num_examples: 200 |
| - name: NanoCodeRAGStackoverflowPosts |
| num_bytes: 1188297 |
| num_examples: 200 |
| download_size: 4676749 |
| dataset_size: 4670737 |
| - config_name: corpus |
| features: |
| - name: _id |
| dtype: string |
| - name: text |
| dtype: string |
| splits: |
| - name: NanoCodeRAGLibraryDocumentationSolutions |
| num_bytes: 17956921 |
| num_examples: 8683 |
| - name: NanoCodeRAGOnlineTutorials |
| num_bytes: 57578239 |
| num_examples: 9997 |
| - name: NanoCodeRAGProgrammingSolutions |
| num_bytes: 200886 |
| num_examples: 984 |
| - name: NanoCodeRAGStackoverflowPosts |
| num_bytes: 47533159 |
| num_examples: 10000 |
| download_size: 56258007 |
| dataset_size: 123269205 |
| - config_name: harrier_oss_v1_270m |
| features: |
| - name: query-id |
| dtype: string |
| - name: corpus-ids |
| list: string |
| splits: |
| - name: NanoCodeRAGLibraryDocumentationSolutions |
| num_bytes: 1179425 |
| num_examples: 200 |
| - name: NanoCodeRAGOnlineTutorials |
| num_bytes: 1190640 |
| num_examples: 200 |
| - name: NanoCodeRAGProgrammingSolutions |
| num_bytes: 1112088 |
| num_examples: 200 |
| - name: NanoCodeRAGStackoverflowPosts |
| num_bytes: 1189868 |
| num_examples: 200 |
| download_size: 4678100 |
| dataset_size: 4672021 |
| - config_name: qrels |
| features: |
| - name: query-id |
| dtype: string |
| - name: corpus-id |
| dtype: string |
| splits: |
| - name: NanoCodeRAGLibraryDocumentationSolutions |
| num_bytes: 3407 |
| num_examples: 200 |
| - name: NanoCodeRAGOnlineTutorials |
| num_bytes: 3384 |
| num_examples: 200 |
| - name: NanoCodeRAGProgrammingSolutions |
| num_bytes: 3547 |
| num_examples: 200 |
| - name: NanoCodeRAGStackoverflowPosts |
| num_bytes: 3380 |
| num_examples: 200 |
| download_size: 13196 |
| dataset_size: 13718 |
| - config_name: queries |
| features: |
| - name: _id |
| dtype: string |
| - name: text |
| dtype: string |
| splits: |
| - name: NanoCodeRAGLibraryDocumentationSolutions |
| num_bytes: 81590 |
| num_examples: 200 |
| - name: NanoCodeRAGOnlineTutorials |
| num_bytes: 12499 |
| num_examples: 200 |
| - name: NanoCodeRAGProgrammingSolutions |
| num_bytes: 17812 |
| num_examples: 200 |
| - name: NanoCodeRAGStackoverflowPosts |
| num_bytes: 44059 |
| num_examples: 200 |
| download_size: 81432 |
| dataset_size: 155960 |
| - config_name: reranking_hybrid |
| features: |
| - name: query-id |
| dtype: string |
| - name: corpus-ids |
| list: string |
| splits: |
| - name: NanoCodeRAGLibraryDocumentationSolutions |
| num_bytes: 236212 |
| num_examples: 200 |
| - name: NanoCodeRAGOnlineTutorials |
| num_bytes: 239489 |
| num_examples: 200 |
| - name: NanoCodeRAGProgrammingSolutions |
| num_bytes: 219840 |
| num_examples: 200 |
| - name: NanoCodeRAGStackoverflowPosts |
| num_bytes: 239067 |
| num_examples: 200 |
| download_size: 940041 |
| dataset_size: 934608 |
| --- |
| # NanoCodeRAG |
|
|
| This dataset is a Nano-style retrieval dataset for [HAKARI-bench](https://github.com/hakari-bench/hakari-bench). |
|
|
| NanoCodeRAG contains 4 Nano retrieval splits derived from CodeRAG. Each split keeps up to 200 eligible queries and up to 10000 corpus documents, with exact duplicate query and document text removed where the generator records that policy. |
|
|
| ## Usage |
|
|
| ```python |
| from datasets import load_dataset |
| |
| dataset_id = "hakari-bench/NanoCodeRAG" |
| split = "NanoCodeRAGLibraryDocumentationSolutions" |
| |
| queries = load_dataset(dataset_id, "queries", split=split) |
| corpus = load_dataset(dataset_id, "corpus", split=split) |
| qrels = load_dataset(dataset_id, "qrels", split=split) |
| reranking_candidates = load_dataset(dataset_id, "reranking_hybrid", split=split) |
| ``` |
|
|
| ## Data Layout |
|
|
| This dataset uses six Hugging Face Datasets configs: |
|
|
| - `corpus`: documents with `_id` and `text` |
| - `queries`: queries with `_id` and `text` |
| - `qrels`: positive relevance labels with `query-id` and `corpus-id` |
| - `bm25`: BM25 candidate lists with `query-id` and `corpus-ids` |
| - `harrier_oss_v1_270m`: dense candidate lists from `microsoft/harrier-oss-v1-270m` |
| - `reranking_hybrid`: RRF candidate lists built from `bm25` and `harrier_oss_v1_270m` |
|
|
| Each config has the same Nano split names. |
|
|
| ## Candidate Construction |
|
|
| - `bm25`: local BM25 top-500 with automatic language-aware tokenization. The resolved tokenizer is shown in the Candidate Quality table, for example `wordseg@ja`. |
| - `harrier_oss_v1_270m`: dense top-500 from `microsoft/harrier-oss-v1-270m`. In tables this is shown as `Dense`; Dense means `microsoft/harrier-oss-v1-270m` with the `web_search_query` prompt for queries and cosine similarity over normalized embeddings. |
| - `reranking_hybrid`: RRF over `bm25` and `harrier_oss_v1_270m` using `rrf_k=100`, keeping the RRF top-100. |
|
|
| Safeguard means rank 101 is appended only when RRF top-100 contains no qrels-positive document. |
|
|
| ## Split Statistics |
|
|
| Length statistics are character counts computed with `len(str(text))`. |
|
|
| | Nano split | Queries | Corpus | Qrels | Query chars avg | Query chars p50 | Query chars p75 | Doc chars avg | Doc chars p50 | Doc chars p75 | |
| |---|---:|---:|---:|---:|---:|---:|---:|---:|---:| |
| | NanoCodeRAGLibraryDocumentationSolutions | 200 | 8683 | 200 | 397.4 | 110.0 | 127.2 | 2045.7 | 765.0 | 1842.5 | |
| | NanoCodeRAGOnlineTutorials | 200 | 9997 | 200 | 51.9 | 47.0 | 63.0 | 5722.5 | 3419.0 | 6795.0 | |
| | NanoCodeRAGProgrammingSolutions | 200 | 984 | 200 | 78.3 | 78.0 | 89.2 | 189.1 | 148.5 | 227.2 | |
| | NanoCodeRAGStackoverflowPosts | 200 | 10000 | 200 | 209.8 | 185.5 | 269.0 | 4735.0 | 2864.5 | 5301.0 | |
|
|
| ## Candidate Quality |
|
|
| `nDCG@10` and `Recall@100` are computed from the included candidate rankings against the included qrels, then reported as 0-100 scores such as `52.45`. `Recall@100` uses only the top 100 candidates; an optional rank-101 safeguard positive is not counted in `Recall@100`. |
|
|
| Dense means `microsoft/harrier-oss-v1-270m` with the `web_search_query` prompt and cosine similarity. |
|
|
| | Nano split | BM25 tokenizer | BM25 nDCG@10 | Dense nDCG@10 | Hybrid nDCG@10 | BM25 Recall@100 | Dense Recall@100 | Hybrid Recall@100 | Hybrid candidates | Safeguard positives | |
| |---|---|---:|---:|---:|---:|---:|---:|---:|---:| |
| | Mean | - | 58.23 | 82.96 | 66.85 | 80.50 | 95.12 | 97.75 | - | 18 | |
| | NanoCodeRAGLibraryDocumentationSolutions | regex | 68.67 | 76.45 | 75.44 | 92.00 | 92.50 | 94.50 | 100-101 | 11 | |
| | NanoCodeRAGOnlineTutorials | regex | 81.75 | 90.27 | 86.73 | 97.00 | 95.50 | 100.00 | 100 | 0 | |
| | NanoCodeRAGProgrammingSolutions | regex | 5.12 | 76.46 | 21.51 | 36.50 | 96.50 | 96.50 | 100-101 | 7 | |
| | NanoCodeRAGStackoverflowPosts | regex | 77.37 | 88.65 | 83.73 | 96.50 | 96.00 | 100.00 | 100 | 0 | |
|
|
| ## Hybrid Safeguard Summary |
|
|
| - Safeguard positives: 18 |
| - Rows limited by corpus size: 0 |
| - Metadata file: `reranking_hybrid_metadata.json` |
|
|
| ## Source Links |
|
|
| - Source benchmark: `CodeRAG` |
| - `code-rag-bench/library-documentation`: https://huggingface.co/datasets/code-rag-bench/library-documentation |
| - `code-rag-bench/online-tutorials`: https://huggingface.co/datasets/code-rag-bench/online-tutorials |
| - `code-rag-bench/programming-solutions`: https://huggingface.co/datasets/code-rag-bench/programming-solutions |
| - `code-rag-bench/stackoverflow-posts`: https://huggingface.co/datasets/code-rag-bench/stackoverflow-posts |
|
|
| ## License |
|
|
| NanoCodeRAG is a derived dataset. Users must comply with the licenses, terms, and attribution requirements of the upstream datasets and benchmarks. |
|
|