Skip to content

Commit

Permalink
readme updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gkamradt committed Nov 28, 2023
1 parent 546175c commit dfc15a9
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
4 changes: 2 additions & 2 deletions LLMNeedleHaystackTester.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def get_results(self):

def print_start_test_summary(self):
print ("\n")
print ("Starting Needle In A Haystack Testing")
print ("Starting Needle In A Haystack Testing...")
print (f"- Model: {self.model_name}")
print (f"- Context Lengths: {len(self.context_lengths)}, Min: {min(self.context_lengths)}, Max: {max(self.context_lengths)}")
print (f"- Document Depths: {len(self.document_depth_percents)}, Min: {min(self.document_depth_percents)}%, Max: {max(self.document_depth_percents)}%")
Expand All @@ -460,6 +460,6 @@ def start_test(self):

if __name__ == "__main__":
# Tons of defaults set, check out the LLMNeedleHaystackTester's init for more info
ht = LLMNeedleHaystackTester(document_depth_percent_interval_type='sigmoid', model_provider='Anthropic', model_name='claude-2.1')
ht = LLMNeedleHaystackTester()

ht.start_test()
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ A simple 'needle in a haystack' analysis to test in-context retrieval ability of

Get the behind the scenes on the [overview video](https://youtu.be/KwRRuiCCdmc).

**The Test**
![GPT-4-128 Context Testing](img/NeedleHaystackCodeSnippet.png)

## The Test
1. Place a random fact or statement (the 'needle') in the middle of a long context window (the 'haystack')
2. Ask the model to retrieve this statement
3. Iterate over various document depths (where the needle is placed) and context lengths to measure performance
Expand Down
Binary file added img/NeedleHaystackCodeSnippet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
aiohttp==3.9.1
aiosignal==1.3.1
annotated-types==0.6.0
anthropic==0.7.5
anyio==3.7.1
attrs==23.1.0
certifi==2023.11.17
charset-normalizer==3.3.2
dataclasses-json==0.6.3
distro==1.8.0
filelock==3.13.1
frozenlist==1.4.0
fsspec==2023.10.0
h11==0.14.0
httpcore==1.0.2
httpx==0.25.2
huggingface-hub==0.19.4
idna==3.6
jsonpatch==1.33
jsonpointer==2.4
langchain==0.0.341
langchain-core==0.0.6
langsmith==0.0.67
marshmallow==3.20.1
multidict==6.0.4
mypy-extensions==1.0.0
numpy==1.26.2
openai==1.3.5
packaging==23.2
pydantic==2.5.2
pydantic_core==2.14.5
python-dotenv==1.0.0
PyYAML==6.0.1
regex==2023.10.3
requests==2.31.0
sniffio==1.3.0
SQLAlchemy==2.0.23
tenacity==8.2.3
tiktoken==0.5.1
tokenizers==0.15.0
tqdm==4.66.1
typing-inspect==0.9.0
typing_extensions==4.8.0
urllib3==2.1.0
yarl==1.9.3

0 comments on commit dfc15a9

Please sign in to comment.