Open-source AI large language models (LLMs) like DeepSeek and Qwen have demonstrated excellent performance. With tools like Ollama and LM Studio, we can easily set up local LLM services and integrate them into various AI applications, such as video translation software.
However, due to the memory limitations of personal computers, locally deployed LLMs are often smaller, such as 1.5B, 7B, 14B, or 32B.
The DeepSeek official online AI service uses the r1 model, which has a staggering 671B parameters. This significant difference means that the intelligence of local models is relatively limited, and they cannot be used as freely as online models. Otherwise, you may encounter various strange issues, such as prompts appearing in the translation results, a mixture of the original text and the translation, or even garbled characters.
The root cause is that smaller models have insufficient intelligence and weak understanding and execution capabilities for complex prompts.
Therefore, when using local LLMs for video translation, you need to pay attention to the following points to obtain better translation results:
I. Correctly Configure the API Settings of the Video Translation Software
Enter the API address of the locally deployed model in the API interface address
field under Translation Settings --> Compatible AI and Local Large Models in the video translation software. Typically, the API interface address should end with /v1
.
- If your API interface is set up with an API Key, enter it in the SK text box. If it is not set, enter any value, such as
1234
, but do not leave it blank. - Enter the model name in the Fill in all available models text box. Note: Some model names may have size information after them, such as
deepseek-r1:8b
. The:8b
at the end also needs to be entered.
II. Prioritize Models with Larger Parameter Sizes and Newer Versions
- It is recommended to choose models with a parameter size of at least 7B. If conditions permit, try to choose models larger than 14B. Of course, the larger the model, the better the effect, provided your computer performance allows.
- If you are using the Tongyi Qianwen series of models, prioritize the qwen2.5 series over the 1.5 or 2.0 series.
III. Uncheck the "Send Complete Subtitles" Option in the Video Translation Software
Unless the size of the model you deployed is greater than or equal to 70B, checking "Send Complete Subtitles" may cause errors in the subtitle translation results.
IV. Properly Set the Number of Subtitle Lines Parameter
Set both the Traditional Translation Subtitle Lines and AI Translation Subtitle Lines in the video translation software to smaller values, such as 1, 5, or 10. This can avoid the problem of too many blank lines and improve the reliability of the translation.
The smaller the value, the lower the possibility of translation errors, but the translation quality will also decrease; the larger the value, although the translation quality is better when there are no errors, it is also more prone to errors.
V. Simplify Prompts
When the model is small, it may not be able to understand or follow instructions well. At this time, you can simplify the prompt to make it simple and clear.
For example, the prompt in the default software directory/videotrans/localllm.txt
file may be more complex. When you find that the translation results are not satisfactory, you can try to simplify it.
Simplified Example 1:
# Role
You are a translation assistant who can translate the text within the <INPUT> tag into {lang}.
## Requirements
- The number of translated lines must be equal to the number of original lines
- Translate according to the literal meaning, do not explain the original text.
- Only return the translation, do not return the original text.
- If you cannot translate, return a blank line, do not apologize, and do not explain the reason.
## Output format:
Directly output the translation, do not output any other prompts, such as explanations, guide characters, etc.
<INPUT></INPUT>
Translation result:
Simplified Example 2:
You are a translation assistant. Translate the following text into {lang}, keep the number of lines unchanged, only return the translation, and return a blank line if you cannot translate.
Text to be translated:
<INPUT></INPUT>
Translation result:
Simplified Example 3:
Translate the following text into {lang}, keeping the number of lines consistent. Leave it blank if you cannot translate.
<INPUT></INPUT>
Translation result:
You can further simplify and optimize the prompt according to the actual situation.
By optimizing the above points, even smaller local LLMs can play a greater role in video translation, reduce errors, improve translation quality, and bring you a better local AI experience.