[ENHANCEMENT] Improve prompt consistency to reduce hallucinated and inconsistent LLM outputs#419
Open
Lochit-Vinay wants to merge 11 commits intofireform-core:mainfrom
Open
[ENHANCEMENT] Improve prompt consistency to reduce hallucinated and inconsistent LLM outputs#419Lochit-Vinay wants to merge 11 commits intofireform-core:mainfrom
Lochit-Vinay wants to merge 11 commits intofireform-core:mainfrom
Conversation
Author
|
Happy to refine the prompt further if there are specific edge cases or scenarios you'd like me to cover. |
Author
|
Resolved merge conflicts with latest Also ensured:
Happy to make further refinements if needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #418
Context
While working with the extraction pipeline and trying out different inputs, I noticed that the current prompts sometimes lead to slightly inconsistent outputs from the LLM.
In particular, there were cases where:
The earlier prompt improvements helped structure the output better, but there were still edge cases where the model “over-interprets” the input.
What I changed
This PR focuses on tightening the prompt instructions so the model behaves more predictably.
Why this helps
These changes make the extraction more deterministic and reduce cases where the model tries to be “helpful” by adding or modifying information.
This should improve:
Testing
Due to the current database setup not being fully configured in this repository, I wasn’t able to run a complete end-to-end API test.
Instead, I focused on validating the prompt generation directly:
Verified that:
This ensures that the LLM receives clearer and stricter instructions, which helps reduce hallucination and improves consistency in the output.