-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
72 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,30 @@ | ||
.. _large_language_model: | ||
|
||
========= | ||
Prompting | ||
========= | ||
==================== | ||
Large Language Model | ||
==================== | ||
|
||
Prompting for API documentation | ||
=============================== | ||
In the RAG framework, the Large Language Model (LLM) is the cherry on top. It is in | ||
charge of generating the answer to the query based on the context retrieved. | ||
|
||
:class:`~ragger_duck.prompt.BasicPromptingStrategy` implements a prompting | ||
strategy to answer documentation questions. We get context by reranking the | ||
search from a lexical and semantic retrievers. Once the context is retrieved, | ||
we request a Large Language Model (LLM) to answer the question. | ||
A rather important part of the LLM is related to the prompt to trigger the generation. | ||
In this POC, we did not intend to optimize the prompt because we did not have the data | ||
at hand to make a proper evaluation. | ||
|
||
:class:`~ragger_duck.prompt.BasicPromptingStrategy` allows to interface the LLM with | ||
the context found by the retriever. For prototyping purposes, we also allow the | ||
retrievers to be bypassed. The prompt provided to the LLM is the following:: | ||
|
||
prompt = ( | ||
"[INST] You are a scikit-learn expert that should be able to answer" | ||
" machine-learning question.\n\nAnswer to the query below using the" | ||
" additional provided content. The additional content is composed of" | ||
" the HTML link to the source and the extracted contextual" | ||
" information.\n\nBe succinct.\n\n" | ||
"Make sure to use backticks whenever you refer to class, function, " | ||
"method, or name that contains underscores.\n\n" | ||
f"query: {query}\n\n{context_query} [/INST]." | ||
) | ||
|
||
When bypassing the retrievers, we do not provide any context and the sentence related | ||
to this part. |
Binary file not shown.
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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