Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
# CoRNStack Python Dataset
|
5 |
+
|
6 |
+
The CoRNStack Dataset, accepted to [ICLR 2025](https://arxiv.org/abs/2412.01007), is a large-scale high quality training dataset specifically for code retrieval across multiple
|
7 |
+
programming languages. This dataset comprises of `<query, positive, negative>` triplets used to train [nomic-embed-code](https://huggingface.co/nomic-ai/nomic-embed-code),
|
8 |
+
[CodeRankEmbed](https://huggingface.co/nomic-ai/CodeRankEmbed), and [CodeRankLLM](https://huggingface.co/nomic-ai/CodeRankLLM).
|
9 |
+
|
10 |
+
|
11 |
+
## CoRNStack Dataset Curation
|
12 |
+
Starting with the deduplicated Stackv2, we create text-code pairs from function docstrings and respective code. We filtered out low-quality pairs where the docstring wasn't English, too short, or that contained URLs, HTML tags, or invalid characters. We additionally kept docstrings with text lengths of 256 tokens or longer to help the model learn long-range dependencies.
|
13 |
+
|
14 |
+
|
15 |
+

|
16 |
+
|
17 |
+
After the initial filtering, we used dual-consistency filtering to remove potentially noisy examples. We embed each docstring and code pair and compute the similarity between each docstring and every code example. We remove pairs from the dataset if the corresponding code example is not found in the top-2 most similar examples for a given docstring.
|
18 |
+
|
19 |
+
During training, we employ a novel curriculum-based hard negative mining strategy to ensure the model learns from challenging examples. We use a softmax-based sampling strategy to progressively sample hard negatives with increasing difficulty over time.
|
20 |
+
|
21 |
+
|
22 |
+
## Join the Nomic Community
|
23 |
+
|
24 |
+
- Nomic Embed Ecosystem: [https://www.nomic.ai/embed](https://www.nomic.ai/embed)
|
25 |
+
- Website: [https://nomic.ai](https://nomic.ai)
|
26 |
+
- Twitter: [https://twitter.com/nomic_ai](https://twitter.com/nomic_ai)
|
27 |
+
- Discord: [https://discord.gg/myY5YDR8z8](https://discord.gg/myY5YDR8z8)
|
28 |
+
|
29 |
+
# Citation
|
30 |
+
|
31 |
+
If you find the model, dataset, or training code useful, please cite our work:
|
32 |
+
|
33 |
+
```bibtex
|
34 |
+
@misc{suresh2025cornstackhighqualitycontrastivedata,
|
35 |
+
title={CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking},
|
36 |
+
author={Tarun Suresh and Revanth Gangi Reddy and Yifei Xu and Zach Nussbaum and Andriy Mulyar and Brandon Duderstadt and Heng Ji},
|
37 |
+
year={2025},
|
38 |
+
eprint={2412.01007},
|
39 |
+
archivePrefix={arXiv},
|
40 |
+
primaryClass={cs.CL},
|
41 |
+
url={https://arxiv.org/abs/2412.01007},
|
42 |
+
}
|