Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citation numbers should be after the full stop instead of before #645

Open
bryceerobertson opened this issue May 27, 2024 · 6 comments
Open
Assignees

Comments

@bryceerobertson
Copy link
Member

See e.g. Wikipedia.

Image

@bryceerobertson bryceerobertson converted this from a draft issue May 27, 2024
@mruwnik
Copy link
Collaborator

mruwnik commented Jun 5, 2024

requires prompt engineering, as this is returned by the LLM

@bryceerobertson
Copy link
Member Author

@melissasamworth who's in charge of prompt engineering?

@LeMurphant
Copy link
Collaborator

@bryceerobertson afaik there is not a single person, but Matthew (@matthew1970 on Discord) has been poking around with prompt engineering. AFAIK he is not on Github

@mwatkins1970
Copy link

I've submitted a PR (#148) that fixes this issue by updating the example in settings.py's QUESTION_PROMPT to show the period before the citation brackets. This should help ensure consistent citation formatting throughout responses.

@LeMurphant
Copy link
Collaborator

LeMurphant commented Nov 9, 2024

I'm not sure it's possible to cross-link between projects, but here's a try
StampyAI/stampy-chat#148
Edit: It works!

@bryceerobertson
Copy link
Member Author

bryceerobertson commented Nov 25, 2024

Update: @LeMurphant will give this a go using the following recommendation from Matthew:

Most frustratingly, I can't run the code on my local machine (outdated MacOS won't support all the necessary packages), so I can't test it.

As I wrote in the github pull request notes:

"This was simply a matter of changing one line in stampy-chat/api/src/stampy_chat/settings.py

QUESTION_PROMPT = (
"In your answer, please cite any claims you make back to each source "
"using the format: [1], [2], etc. If you use multiple sources to make a claim "
"cite all of them. For example: "AGI is concerning [1, 3, 8]."\n\n"
)
to

QUESTION_PROMPT = (
"In your answer, please cite any claims you make back to each source "
"using the format: [1], [2], etc. If you use multiple sources to make a claim "
"cite all of them. For example: "AGI is concerning. [1, 3, 8]" (note the period placement)\n\n"
)

I am unable to run this codebase on my local machine (due to dependencies issues caused by an outdated MacOS, I think), but I'm 98% confident this will work, since the reason for the unwanted behaviour was so explicit."
So perhaps rather than me iterating over variations of QUESTION_PROMPT via github, someone could with a better setup could just try a few variations. I would suggest changing

For example: "AGI is concerning. [1, 3, 8]" (note the period placement)\n\n"

to

For example: "AGI is concerning. [1, 3, 8]" (note that the period is placed before the citation numbers)\n\n"

or even

For example: "AGI is concerning. [1, 3, 8]" (it is very important that the period is placed before the citation numbers)\n\n"

I used the most terse wording I could to save on token expenditure, but I'm confident that a more explicit instruction would do the job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Todo
Development

No branches or pull requests

4 participants