Skip to content

Add "et al." to invalid citation examples in prompt#1316

Merged
jamesbraza merged 2 commits intomainfrom
add-et-al-invalid-citation-example
Mar 12, 2026
Merged

Add "et al." to invalid citation examples in prompt#1316
jamesbraza merged 2 commits intomainfrom
add-et-al-invalid-citation-example

Conversation

@jamesbraza
Copy link
Copy Markdown
Collaborator

@jamesbraza jamesbraza commented Mar 11, 2026

Summary

CITATION_KEY_CONSTRAINTS lists invalid citation formats to steer LLMs toward using pqac-* citation keys. However, all the invalid examples only show wrong ways to format pqac-* 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 correct pqac-* 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_CONSTRAINTS in prompts.py by adding Author et al. (2023) as an explicit invalid citation example to reduce the model mixing academic-style citations with pqac-* 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.

@jamesbraza jamesbraza added the bug Something isn't working label Mar 11, 2026
@jamesbraza jamesbraza self-assigned this Mar 11, 2026
@jamesbraza jamesbraza added the bug Something isn't working label Mar 11, 2026
Copilot AI review requested due to automatic review settings March 11, 2026 20:47
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 11, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dosubot dosubot bot added the enhancement New feature or request label Mar 11, 2026
@jamesbraza jamesbraza force-pushed the add-et-al-invalid-citation-example branch from 6abce43 to cad33e1 Compare March 11, 2026 21:20
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
@jamesbraza jamesbraza force-pushed the add-et-al-invalid-citation-example branch from cad33e1 to 26d96e4 Compare March 11, 2026 21:23
@jamesbraza jamesbraza merged commit e1b6d3e into main Mar 12, 2026
6 of 7 checks passed
@jamesbraza jamesbraza deleted the add-et-al-invalid-citation-example branch March 12, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants