Add "et al." to invalid citation examples in prompt#1316
Merged
jamesbraza merged 2 commits intomainfrom Mar 12, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the CITATION_KEY_CONSTRAINTS prompt in paperqa to more explicitly discourage non-pqac-* academic-style author/year citations (e.g., “et al.”) that sometimes appear in long-form model outputs.
Changes:
- Adds
- Author et al. (2023)to the “Invalid citation examples” list. - Ensures the preceding invalid example line ends with a newline so the new bullet renders separately.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
6abce43 to
cad33e1
Compare
The CITATION_KEY_CONSTRAINTS prompt lists invalid citation formats to steer LLMs toward using pqac-* citation keys. However, it only showed invalid ways to format pqac keys themselves, with no example prohibiting academic-style author citations. In long answers, LLMs occasionally slip in "Author et al. (year)" citations alongside correct pqac keys. Add "Author et al. (2023)" as an invalid citation example so the constraint covers this failure mode. Made-with: Cursor
Made-with: Cursor
cad33e1 to
26d96e4
Compare
MicPie
approved these changes
Mar 12, 2026
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.
Summary
CITATION_KEY_CONSTRAINTSlists invalid citation formats to steer LLMs toward usingpqac-*citation keys. However, all the invalid examples only show wrong ways to formatpqac-*keys themselves -- there is no example prohibiting academic-style author citations.In practice, on long answers the answer LLM occasionally slips in citations like
Deschamps et al. (2004)alongside otherwise correctpqac-*keys. The existing prompt instructions ("only use the valid keys") are not always sufficient to prevent this.This PR adds
- Author et al. (2023)as an invalid citation example so the constraint explicitly covers this failure mode.Made with Cursor
Note
Low Risk
Low risk: this only tweaks prompt text to further constrain LLM citation formatting, with no code-path, security, or data-handling changes.
Overview
Tightens
CITATION_KEY_CONSTRAINTSinprompts.pyby addingAuthor et al. (2023)as an explicit invalid citation example to reduce the model mixing academic-style citations withpqac-*keys.Also fixes a missing trailing newline in the existing invalid example
- (pages pqac-d79ef6fa)to keep formatting consistent.Written by Cursor Bugbot for commit 6abce43. Configure here.