This is a Python demonstration of a three-step translation workflow that uses a large language model to improve its own output. The process works like this: the model first translates a piece of text from one language to another, then it reads back its own translation and writes a list of suggestions for how to make it better, and finally it produces a revised translation using those suggestions. The idea is that this back-and-forth reflection can catch errors that a single-pass translation would miss. One practical advantage of this approach over traditional translation software is that you can steer the output in ways that are hard to do otherwise. You can include a glossary of terms that must be translated consistently, specify a writing style (formal or informal), or tell it to use a particular regional dialect, such as Mexican Spanish rather than Castilian Spanish. That kind of fine-grained control is difficult to get from a typical translation system. The project was created by Andrew Ng as a personal experiment over several weekends, with help from a few collaborators who assisted with code cleanup. The README notes clearly that this is not mature software and that performance measured against standard benchmarks is sometimes competitive with commercial services and sometimes worse. The goal of releasing it is to encourage experimentation and open-source contributions rather than to offer a production-ready tool. To run it yourself you need Python, the Poetry package manager, and an OpenAI API key. Once installed, calling the translate function takes a source language, a target language, an optional country for regional tuning, and the text to translate. The code is released under the MIT license.
← andrewyng on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.