Stage 1
Translate with a constraint-aware prompt
Given source sentence $X$ and bilingual constraints $\langle S,T\rangle=\{\langle s_1,t_1\rangle,\dots,\langle s_k,t_k\rangle\}$, the LLM must produce $Y=\mathrm{Trans}(f(X,\langle S,T\rangle))$ with every target term $t_i$ in $Y$. A natural-language instruction turns the LLM into a constraint-aware translator:
Translate prompt
Translate the sentence from [src-lang] to [tgt-lang], ensuring the provided constraints are reflected in the translation.
The constraints are given in no specific order. Only provide the translation result.
Sentence: X
Constraints: 〈S,T〉
Output:
Stage 2
Revise with the constraints that were missed
A rule-based checker (the same procedure used to compute CCR) finds the uncompleted constraints $\langle S,T\rangle^{un}_i$. The LLM, now acting as a reviser, receives the source, its current translation, all constraints and the uncompleted ones. The loop stops when every constraint is met or a maximum number of rounds is reached:
$$Y_{i+1}=\mathrm{Revise}\big(f(X,\ \langle S,T\rangle,\ \langle S,T\rangle^{un}_{i},\ Y_{i})\big)$$
Revise prompt
Given a sentence in [src-lang], its constraints, and its current translation in [tgt-lang]:
Original [src-lang] sentence: X
Constraints: 〈S,T〉
Current translation: Y_flawed
Please provide a revised translation based on the following error message, ensuring that all the constraints are accurately reflected in the translation:
Uncompleted constraints: 〈S,T〉_un
Revised translation result: