Open-source AI Large Language Models (LLMs) like DeepSeek and Qwen have demonstrated remarkable capabilities. With tools like Ollama and LM Studio, deploying these models locally is now easier than ever, allowing seamless integration into AI-powered applications, such as video translation software.
However, due to the memory limitations of personal computers, locally deployed LLMs often come in smaller sizes, such as 1.5B, 7B, 14B, or 32B parameters.
In comparison, DeepSeek's official online AI service utilizes the r1 model, boasting a staggering 671B parameters. This significant difference means that the intelligence of local models is relatively limited. You can't use them as freely as online models. Overlooking this can lead to unexpected issues, such as prompts appearing in the translation results, mixing of original and translated text, or even garbled output.
The root cause is the limited intelligence of smaller models, which makes it harder for them to understand and execute complex prompts effectively.
Therefore, when using local LLMs for video translation, keep the following points in mind to achieve better translation results:
1. Configure the API Settings of Your Video Translation Software Correctly
Enter the API address of your locally deployed model in the API Endpoint
field under Translation Settings --> Compatibility with AI & Local LLMs in your video translation software. Typically, the API endpoint address should end with /v1
.
- If your API endpoint requires an API Key, enter it in the SK text box. If not, enter any value (e.g.,
1234
), but do not leave it blank. - Enter the model name in the Available Models text box. Note: Some model names may include size information, such as
deepseek-r1:8b
; be sure to include the:8b
at the end.
2. Prioritize Larger, More Up-to-Date Models
- It is recommended to choose models with at least 7B parameters. If possible, opt for models larger than 14B. Of course, the larger the model, the better the results, provided your computer's performance can handle it.
- When using the Qwen series models (通义千问), prioritize the qwen2.5 series over the 1.5 or 2.0 series.
3. Disable the "Send Complete Subtitle" Option in Your Video Translation Software
Unless your deployed model is 70B or larger, enabling "Send Complete Subtitle" may cause errors in the subtitle translation results.
4. Configure Subtitle Line Number Parameters Appropriately
Set both the Traditional Translation Subtitle Lines and AI Translation Subtitle Lines parameters in your video translation software to small values, such as 1, 5, or 10. This can prevent excessive blank lines and improve translation reliability.
The smaller the value, the lower the probability of translation errors, but the translation quality will also decrease; the larger the value, the better the translation quality when there are no errors, but the easier it is to make mistakes.
5. Simplify Your Prompts
Smaller models may struggle with understanding or following complex instructions. In such cases, simplify your prompts to make them clear and concise.
For example, the default prompt in Software Directory/videotrans/localllm.txt
may be complex. If you find the translation results unsatisfactory, try simplifying it.
Simplified Example 1:
# Role
You are a translation assistant capable of translating text within <INPUT> tags into {lang}.
## Requirements
- The number of lines in the translated text must be equal to the number of lines in the original text.
- Translate literally, without interpreting the original text.
- Only return the translated text, and do not return the original text.
- If you cannot translate, return a blank line, without apologizing or explaining the reason.
## Output Format:
Directly output the translated text, without any other prompts, such as explanations or guide characters.
<INPUT></INPUT>
Translation result:
Simplified Example 2:
You are a translation assistant. Translate the following text into {lang}, keeping the number of lines the same. Only return the translated text; if translation is impossible, return a blank line.
Text to be translated:
<INPUT></INPUT>
Translation result:
Simplified Example 3:
Translate the following text into {lang}, maintaining the same number of lines. Leave blank if translation is not possible.
<INPUT></INPUT>
Translation result:
You can further simplify and optimize the prompts based on your specific needs.
By implementing the above optimizations, even smaller local LLMs can play a greater role in video translation, reducing errors, improving translation quality, and providing you with a better local AI experience.