-
New Feature
-
Resolution: Fixed
-
None
-
High
-
Important: The latest translate5 docker image (with PHP 8.3) is required for the updated OpenAI library
-
-
Emptyshow more show less
Problem
Not all models are trainable (majority is not). And even for trainable models it is often to cost-intensive, to train them.
Therefore it is necessary to allow AI language resources, that use defined prompt compositions and examples, but send the data with every request.
Solution
We introduce "RAG-based prompting". It a non-trainable Model, where a trainings system-message and examples are sent alongside every translation request. To achieve this, the following adjustments have to be made (the basics are already there):
- The same training window is used with some changed texts
- Every model is usable for RAG, it will be added to "specificData" if it is active (to avoid additional queries for index-requests)
- If you open the training window
- At the start of the top bar of the window (before display of the name of it) we display:
- DE: Typ: As is / RAG-based / Trained|Untrained | NAME_OF_RESOURCE
- EN: Type: As is / RAG-basiert / Trainiert|Untrainiert | NAME_OF_RESOURCE
- If resource was not trained yet and is model type is trainable
- Next to the "Submit training" button a "Save as RAG-based" (DE: "Als RAG-based speichern") button is added
- If "RAG-based" prompts have been saved,
- their look and feel stays like before, but a green check-mark is added at before the Prompt-title in the prompt header
- The "Submit training" button is removed
- Any time prompts can be edited, new prompts added or existing ones removed
- If resource is trained,
- training window looks like it does now and "Save as RAG-based" button is removed
- Two new Checkboxes - that will be saved in the Assoc:
- Use examples for RAG-based prompting
- Use source and target language for RAG-based prompting (by default, only targets are used as reference-translation
- At the start of the top bar of the window (before display of the name of it) we display:
For RAG-based language resources the restriction to have at least 10 examples in the prompts is removed.
RAG-based language resources use prompts and their examples directly from the prompt management. In case they are changed there, they are changed in the language resources when used next. This is even beneficial because it allows to improve prompts of multiple language resources at once.
There will be a new table to associate sysmessages with languageresources directly
LEK_openai_ragbased_assoc
columns: ( id | languageresourceId | sysmsgId )
- relates to
-
TRANSLATE-5074 Prompts should be available without examples for RAG-based prompting
- Selected for dev
-
TRANSLATE-5075 RAG-based prompting make UI window area resizable
- Selected for dev