Translating an arXiv Paper into Chinese with One Line of Code
Longtime readers may know that I'm a fairly committed "old-school programming enthusiast" — to this day I still don't use an IDE, don't use code completion, and my editor only needs syntax highlighting. Even the posts on Scientific Spaces are typed out character by character in raw HTML (for historical reasons, admittedly), and the entire codebase of Cool Papers, front end to back end, is also hand-typed by me.
But even a "die-hard" like me has to admit: for certain tasks, AI agents have an unrivaled advantage — some tasks feel like there's simply no way to even begin doing them by hand. This post covers a classic example: translating an arXiv paper into Chinese with a single line of code.
The Method
First, deploy kimi-cli locally and configure it to use kimi-k2.5. You'll also need a LaTeX compilation environment (I use MacTeX). Finally, download the paper's source from arXiv, extract it, navigate into the source directory, and run:
kimi --print --prompt "The directory you're in contains the LaTeX source of an English paper. Your task is to translate the paper into Chinese. All English text content should be translated into Chinese; formulas should remain unchanged; for tables, figures, etc., only the necessary captions need to be translated; for code blocks and algorithm blocks, only the necessary comments need to be translated; personal names do not need to be translated. Save the translated source into a new directory named 'paper_cn' in the current directory, making sure to preserve the compilability of the source. After translating, carefully check whether any sections or files were missed. Finally, use xelatex to recompile the translation into a PDF and return the path to the generated PDF. If there is a lot of content to translate, you should launch multiple subagents to translate in parallel."
Then you just wait for the translation to finish. During this process, kimi will automatically analyze the directory structure, find the files that need translating, and after translating attempt to compile the result, adjusting the translation based on the compiler's error messages until compilation succeeds and a PDF is produced. If you'd rather skip even downloading the source yourself, you can try:
kimi --print --prompt "Download the source of the paper with arXiv id 2502.16982, extract it, and translate it into Chinese. All English text content should be translated into Chinese; formulas should remain unchanged; for tables, figures, etc., only the necessary captions need to be translated; for code blocks and algorithm blocks, only the necessary comments need to be translated; personal names do not need to be translated. Save the translated source into a new directory named 'paper_cn' under the extracted directory, making sure to preserve the compilability of the source. After translating, carefully check whether any sections or files were missed. Finally, use xelatex to recompile the translation into a PDF and return the path to the generated PDF. If there is a lot of content to translate, you should launch multiple subagents to translate in parallel."
I'm using kimi-cli as the example not so much to advertise it, but simply because it's the only AI agent I've actually used — and even that was because I happened to test it "in passing" for work reasons, rather than actively seeking out AI agent assistance. This just goes to show what an "old fogey" I really am. If you have other agents you're comfortable with, feel free to try them too.
Comparing Results
Among the existing paper-translation websites out there, I think the best one is "Hallucination Translation (hjfy.top)". Below are the results of translating two papers using kimi and hjfy respectively:
1. kda_chinese_kimi.pdf;
2. kda_chinese_hjfy.pdf;
3. moonlight_chinese_kimi.pdf;
4. moonlight_chinese_hjfy.pdf.
Feel free to compare them yourself:
kda_chinese_kimi
kda_chinese_hjfy
moonlight_chinese_kimi
moonlight_chinese_hjfy
A Few More Words
The author of Hallucination Translation once shared the reasoning behind their approach in a Zhihu article titled "Spending 300 Million Tokens: How I Used a Large Model to Translate 10,000 arXiv Papers". The basic idea is probably something most people could come up with on their own: start from the paper's LaTeX source (which arXiv papers generally provide), extract the paragraphs that need translating, and translate them one by one.
However, once you actually try to implement this, you quickly run into that "nowhere to even start" feeling, because LaTeX is an extremely free-form syntax — it's not even really just a document markup language anymore, but has quietly turned into something close to a programming tool. Against that backdrop, trying to manually break "extract-then-translate" down into a finite set of well-defined steps turns out to be extremely difficult. As the author notes, they are still fixing bad cases of mistranslation on a daily basis — this is a long-term, tedious, never-ending job.
And this kind of work — the kind that's hard to manually decompose into an enumerable set of steps — is exactly what AI agents excel at! The AI will automatically locate and decide which files need translating, translate them one by one, and better still, it will automatically try to compile the result and adjust the document based on the error messages until compilation succeeds. If you tried to write rules for this by hand, just handling compilation error messages alone would be an endless task — arguably no less difficult in essence than rewriting a LaTeX compiler from scratch. One can only imagine how painful that would be.
Beyond automation, another benefit of using kimi-cli is translation quality. Compared to translating paragraph by paragraph or even sentence by sentence, kimi-cli's access to global context produces noticeably better overall translation quality. Of course, there are downsides too — the common ailment of large models: hallucination, which manifests as missed or mistranslated passages. In an interactive setting, you can repeatedly ask kimi to check for omissions until you're satisfied, but for outright mistranslations, there may not be much you can do. There's also the matter of speed — going all-in on kimi-cli is somewhat slower.
Summary
This post presented a basic recipe for translating arXiv papers into Chinese using kimi-cli. I'd also welcome anyone who has more refined use cases to share them.
Translated automatically with claude-sonnet-5; all equations are reproduced verbatim from the source. Copyright remains with the original author.