Use Better Models, Better Prompts in Docs #619
Merged
+60
−73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some of the results in the docs are difficult to reproduce. Prompt engineering and better model recommendations are applied here to alleviate that.
fixes #586
mistralai/Mistral-7B-v0.1
, always preferWizardLM/WizardMath-7B-V1.1
for math above kindergarten level andmistralai/Mistral-7B-Instruct-v0.2
for everything else.README.md
andquickstart.md
examples. Replaced model withmistralai/Mistral-7B-Instruct-v0.2
, generation quality was equal or better in all cases.device="cuda"
in anyoutlines.models.transformers
Notes:
https://github.com/outlines-dev/outlines#multiple-choices
mistralai/Mistral-7B-Instruct-v0.2
Before (first token probs):
After (first token probs):
https://github.com/outlines-dev/outlines?tab=readme-ov-file#type-constraint
Now generates
1 + 2 = 3
andsqrt(2) = 1.41421356
.https://github.com/outlines-dev/outlines?tab=readme-ov-file#efficient-json-generation-following-a-pydantic-model
mistralai/Mistral-7B-Instruct-v0.2
Before:
name=B__k_ __lf
?After:
https://github.com/outlines-dev/outlines?tab=readme-ov-file#using-context-free-grammars-to-guide-generation
WizardLM/WizardMath-7B-V1.1
Before:
After:
https://github.com/outlines-dev/outlines?tab=readme-ov-file#open-functions
WizardLM/WizardMath-7B-V1.1
Before:
Generates whitespace, never ending
After:
https://github.com/lapp0/outlines/blob/cfg-examples/docs/quickstart.md#regex-guided-generation
Before:
After:
https://github.com/lapp0/outlines/blob/cfg-examples/docs/quickstart.md#deploy-using-vllm-and-fastapi
This always results in low quality generations, debugging it can be a separate issue. It hardly ever says just "paris" regardless of the model. Pro
Changing to