How Large Language Models Reach Production: Cross-Language Design and an Evaluation Checklist
A practical guide for engineers connecting large language models to business systems. It maps language properties to engineering risks, outlines a second-order quality-check flow, and covers data governance, evaluation metrics, RAG, tool calling, and cross-language retrieval.
Language is not only a communication channel. It is how you encode experience, constrain model output, and connect systems. This article is for developers who need to put large language models into production. It first maps language properties to engineering problems, then gives steps you can execute.
Language properties and engineering counterparts
| Language property | Engineering counterpart | Common failure |
|---|---|---|
| Functional: description, instruction, relations, tasks | Intent recognition and task decomposition | Treating chit-chat as a command and triggering writes by mistake |
| Regional and historical | Corpus distribution, low-resource language adaptation, cultural difference | Strong Chinese data, clearly worse answers in smaller languages |
| Symbolic | Tokenization, embeddings, knowledge organization | The same concept written differently across documents, so retrieval misses it |
| Conventional / role-play | Prompt templates and role settings | Role prompts override safety rules and the model produces out-of-bounds content |
| Agency and mediation | Human control, explainability, tool use | Users cannot undo or correct system actions |
| Professional and creative | Domain fine-tuning, style control, generation quality evaluation | Style is consistent while factual errors go unnoticed |
Use the table as a checklist: write a test next to each property. For “regional,” score evaluation by language group instead of a single average. A global average hides quality drop on low-resource languages.
A philosophical analogy and its limits
Wittgenstein’s “family resemblance” in Philosophical Investigations says members of a category need not share one fixed feature set; overlapping features still form a cluster. In engineering, that is a useful way to think about clustering and similarity search. Documents in one class may not share keywords, but they overlap enough that semantic retrieval finds them more often than keyword matching.
It is only an analogy. It explains why keyword search misses semantically close content. It does not explain how a model represents meaning. Retrieval quality still depends on real evaluation sets and human sampling.
Second-order abstraction: an illustrative flow
Second-order abstraction means the system does not only answer; it also checks its own expression rules and output quality. The following sketch is not runnable.
# Sketch only: illustrates flow, not executable# Input: input_text (str) user text; context (dict) with request_id, goal, constraints# Output: Result with answer, sources, confidence, needs_review, reason# Exception: ToolError (timeout or insufficient permission); error codes agreed with the tool platformdef handle_request(input_text, context):if len(input_text) == 0 or len(input_text) > 4000:return Result(answer=None, needs_review=True, reason="empty or too long input")concepts = extract_symbols(input_text) # entities and intent; depends on the chosen modelrules = infer_rules(concepts, context["constraints"])plan = compose_plan(rules, context["goal"])try:result = execute(plan, timeout_s=3, retries=2)except ToolError as e:log_event("tool_error", code=e.code, request_id=context["request_id"])return Result(answer=None, needs_review=True, reason="tool call failed")reflection = evaluate(result, context["goal"]) # factuality and relevanceif reflection.sources_cover < 0.95:return Result(answer=None, needs_review=True, reason="source coverage too low")if reflection.confidence < 0.7:return Result(answer=None, needs_review=True, reason="low confidence")return revise(result, reflection)
Engineering teams still need to implement extract_symbols and evaluate (they depend on the chosen model and evaluation set), agree ToolError codes with the tool platform, and align Result fields with the frontend and logging.
Example evaluation assertions: empty input must set needs_review to true. On tool timeout, answer must be empty; the system must not invent a result. If source coverage is below 0.95, the system must not emit a definite conclusion.
Cross-language retrieval and tool access
The language model can act as an orchestration layer. When a user says “analyze anomalies from the last three days and generate a report,” the system parses the time range and metrics, then queries logs, metrics, and alerting in sequence, and finally writes the report. Each step should record data sources and query time. Every claim in the report should trace to a specific query result.
In a cross-language setting, the same query may need retrieval over Chinese, English, and Vietnamese corpora. Mixed results should label language source, and the report should state which conclusions come from a single language only.
Configure tool permissions with least privilege. Query tools use read-only accounts. Writes and deletes require a separate request and human confirmation before execution.
Six implementation steps
1. Data governance. Record source, language, authorization status, version, and creation time for every corpus item. Deduplicate and redact before training or indexing. Replace phone numbers, ID numbers, emails, and similar fields with placeholders. Keep raw data only as long as compliance requires—for example, application logs for 30 days, then automatic deletion. Keep a backup before delete so you can roll back within the backup window.
2. Evaluation system. Define five metrics and starting thresholds, then tune them to the business:
- Factuality: human sample of 200 items; error rate no higher than 5%.
- Relevance: among the top 5 retrieved documents, at least 80% relevant.
- Safety: zero violating outputs on the red-team set.
- Style consistency: at least 95% of outputs in a given scenario match the template.
- Task completion: end-to-end success rate at least 90%.
These thresholds are a starting point. Recalibrate with historical data before launch.
3. Retrieval augmentation. Attach source IDs to every answer, pointing to a specific document span and version. If source coverage is below 95%, state that information is insufficient instead of giving a definite conclusion.
4. Tool calling. Define input format, timeout, retry count, and permission level for each tool. Timeout 3 seconds, at most 2 retries, exponential backoff. Writes carry an idempotency key to prevent duplicate submits. On tool failure, return a clear error code; do not generate a substitute result.
5. Observability. Log fields should at least include the identifiers and outcomes needed to trace requests, tool errors, and review decisions, aligned with the frontend and logging system.
