jonathan-roberts1 commited on
Commit
f36082d
·
verified ·
1 Parent(s): 1251c2c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +64 -0
README.md CHANGED
@@ -73,3 +73,67 @@ configs:
73
  - **Homepage:** [https://needle-threading.github.io](https://needle-threading.github.io)
74
  - **Paper:** [Needle Threading: Can LLMs Follow Threads through Near-Million-Scale Haystacks?](https://arxiv.org/abs/)
75
  - **Repository** [Needle Threading](https://github.com/jonathan-roberts1/needle-threading)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  - **Homepage:** [https://needle-threading.github.io](https://needle-threading.github.io)
74
  - **Paper:** [Needle Threading: Can LLMs Follow Threads through Near-Million-Scale Haystacks?](https://arxiv.org/abs/)
75
  - **Repository** [Needle Threading](https://github.com/jonathan-roberts1/needle-threading)
76
+
77
+ ## Dataset Summary
78
+
79
+ As the context limits of Large Language Models (LLMs) increase, the range of possible applications and downstream functions broadens. Although the development of longer context models has seen rapid gains recently, our understanding of how effectively they use their context has not kept pace.
80
+
81
+ To address this, we conduct a set of retrieval experiments designed to evaluate the capabilities of 17 leading LLMs, such as their ability to follow threads of information through the context window.
82
+
83
+ Strikingly, we find that many models are remarkably thread-safe: capable of simultaneously following multiple threads without significant loss in performance. Still, for many models, we find the effective context limit is significantly shorter than the supported context length, with accuracy decreasing as the context window grows.
84
+
85
+ ## Example Usage
86
+
87
+ ### Option 1: HuggingFace datasets
88
+ ```python
89
+ from datasets import load_dataset
90
+
91
+ # task splits can be downloaded separately:
92
+ # splits = ['Single_Needle', 'Multi_Needle', 'Conditional_Needle', 'Single_Thread', 'Multi_Thread']
93
+ single_needle_dataset = load_dataset("jonathan-roberts1/needle-threading", split='Single_Needle')
94
+
95
+ """
96
+ Dataset({
97
+ features: ['id', 'haystack', 'keys', 'values', 'question', 'context_length', 'num_kv_pairs',
98
+ 'repeat_number', 'needle_depth', 'num_needles', 'needle_placement', 'conditional_character',
99
+ 'thread_length', 'thread_direction', 'num_threads'],
100
+ num_rows: 660
101
+ })
102
+ """
103
+
104
+ # query individual questions
105
+ single_needle_dataset[5] # e.g., the 6th element
106
+ """
107
+ {'id': 5, 'haystack': '{"b8a1abcd-1a69-16c7-4da4-f9fc3c6da5d7": "1710cf53-27ac-435a-7a97-c643656412a9",
108
+ "8ca...": "ff478895-5cdb-7f4c-cde9-d231c8a38e7b"}', 'keys': 'ff5a52f1-a058-85ac-7671-863c0bdbc23a',
109
+ 'values': 'a5e333cb-88dc-f943-84d4-cd1f47ca7883',
110
+ 'question': 'Extract the value corresponding to the specified key in the JSON object. Key: "ff5a52...-7671-863c0bdbc23a"\n Corresponding value: ',
111
+ 'context_length': 2000, 'num_kv_pairs': 25, 'repeat_number': 4, 'needle_depth': '50',
112
+ 'num_needles': 1, 'needle_placement': 'depthwise', 'conditional_character': 'N/A',
113
+ 'thread_length': 1, 'thread_direction': 'N/A', 'num_threads': 0}
114
+ """
115
+ ```
116
+
117
+
118
+ ### Option 2: Manual download
119
+
120
+ Directly downloading image files and question data from the needle-threading HuggingFace repository into the ```data``` directory in this repo.
121
+ ```
122
+ cd data
123
+ wget https://huggingface.co/datasets/jonathan-roberts1/needle-threading/resolve/main/data_json.zip
124
+ unzip data_json.zip && rm data_json.zip
125
+ ```
126
+ #### Expected structure
127
+ ```
128
+ ├── data
129
+ ├── json_data
130
+ ├── Single_Needle.json
131
+ ├── Multiple_Needles.json
132
+ ├── Conditional_Needles.json
133
+ ├── Single_Threads.json
134
+ ├── Multi_Threads.json
135
+ ```
136
+
137
+ Note: ```data_json/``` needs to be downloaded.
138
+
139
+ Please visit our [GitHub repository](https://github.com/jonathan-roberts1/needle-threading) for example inference code.