Agent Application DevelopmentAccount
Knowledge catalogChoose core direction and segmented content
knowledge unit 62FundamentalsConceptsAbout 16 minutes

Understand → Implement → Debug → Design

Boundaries between learned capabilities, contextual evidence, and task behavior

Distinguish between capabilities in parameters, evidence in requests, and post-training behavior, and select adaptation methods based on failure reasons.

pre-trainingRAGfine-tuningModel adaptation

Knowledge content check2026-10-03 · Check the source of the original question2026-10-03

Which step do you want to learn from this knowledge point?

Select the starting point based on the current basis, or you can go deeper one by one. When you encounter an unfamiliar concept, go back to the core principles first; use the knowledge exercises to check your understanding when you are finished.

Understand first

New to this knowledge point

Complete the prerequisite concepts, read the principles and counterexamples, and then explain why in your own words.

Start with core principles →

Implement next

Prepare to write the principles into code

Understand implementation steps and boundaries, complete small tasks, and check results against acceptance requirements.

Reading implementation and trade-offs →

Debug failures

Need to handle failures and changes in conditions

Follow the continuous questioning to locate the failure premise, and then compare the migration cases to explain how the plan should be adjusted.

Continue to delve deeper into the problem →

Compare designs

Need to design or review plans

Combine engineering deductions and senior self-evaluation standards to explain the applicable conditions, costs and alternatives of the plan.

Analyze engineering scenarios →
Knowledge unit directory

LEARN · PRACTICE · REFLECT

Knowledge learning and personal records

My notes and review ↗

First read along the principles, Q&A and migration cases. When you need to check your understanding, switch to reinforcement exercises or start personal recording.

Answers and personal notes

Each modified commit will be kept as an independent history. Your level of mastery is up to you to evaluate yourself against the standards.

Core concept · Boundaries between learned capabilities, contextual evidence, and task behavior

Understand the core principles first

Preparatory concepts:The difference between training and inference, Input context and output distribution, Trusted data sources and authorization

Training enables future requests to take different parameters or adapters; context enables different conditions on the current output. Competence, evidence, and accessibility need to be verified separately, and changing one will not automatically fix the other two.

Seeing information is not permanent learning

Generation depends on model parameters and current input. Pretraining learns patterns and knowledge from broad text. Adding a manual during inference changes the conditions for that response; an ordinary call does not train parameters. Another request lacking that manual cannot assume it remains known. Application session storage is a separate data system.

Parameter knowledge and retrieved facts differ

Learned facts may explain context or conflict with current policy. They are not records carrying document versions, page citations, and current ACLs. Training on a new policy does not establish that every phrasing stops using old facts or that revoked users lose access. Updateable, traceable external evidence helps manage changes, but correct retrieval still cannot guarantee faithful interpretation.

Examples determine what fine-tuning teaches

Fixed question-answer pairs may teach those associations. Pairing one question with varying evidence and evidence-dependent answers teaches evidence use more directly. Facts and behavior are not completely separate; fine-tuning may improve domain knowledge, but test unseen facts and phrasings. Memorized training text cannot serve as an authoritative business-state API.

Choose the smallest change using counterexamples

Stable classification with complete input may benefit more from labeled examples than retrieval. A minute-by-minute balance needs an authoritative query, regardless of amounts seen in training. For repeatedly missed conditions in correct evidence, inspect instructions first, then consider training examples. Trusted systems enforce authorization and business certainty; model compliance is not a security proof.

Check understanding with a question

What do pretraining, RAG and fine-tuning change? Why are corporate knowledge questions and answers often used in combination?

Pretraining learns broad capabilities and knowledge; fine-tuning adjusts parameters or adapters; RAG retrieves external evidence per request. Fine-tuning lacks automatic real-time updates, exact citations, or deletion enforcement. RAG cannot guarantee faithful interpretation. Diagnose missing information versus processing errors: retrieve current documents, query live state, and consider fine-tuning stable formats or evidence use after a prompt baseline. Evaluate facts, behavior, access, and cost separately.

Implementation and trade-offs

Three methods act in different locations

Pre-training builds knowledge in extensive capabilities and parameters for the model, and typical autoregressive language models learn text patterns by predicting subsequent Tokens. The parameters obtained are not an enterprise database that can be checked item by item. Fine-tuning and parameter-efficient adaptation continues to train on the existing model, and can update parameters or adapters to make it more suitable for specific input and output distributions; it can improve formatting, classification, terminology understanding, and may also remember new facts. It cannot be summarized as "fine-tuning only the teaching style".

A common application process for RAG is to retrieve data at inference time, put it into the current request, and let the generative model answer based on the question and evidence. This step usually does not change the model parameters; trainable retrievers or joint training with generators also exist, so RAG and fine-tuning are not mutually exclusive architectures. Distinguish where the knowledge comes from and how the model uses it.

Why does corporate knowledge and authorization need external mechanisms?

A policy changed today, or an employee just lost access. The trained parameters will not be automatically synchronized because a document is deleted or the ACL is changed. Even if the model can restate the old policy, it cannot prove which version is currently valid and which passage the person can now read based on this memory alone. Frequently changing documents are suitable for retrieval from updatable sources with enforceable authorization data sources; real-time status such as balances and inventories are preferred to be read with trusted tools. Authorization is performed by the server, and the behavior of training "deny unauthorized questions" cannot replace the real permission check. Also avoid mixing secrets that require fine-grained revocation directly into model training that is shared by all users.

Find the bottleneck first, then decide on adaptation

The model does not know the new policy, and continuing to train the output format does not complement the current facts; the model has obtained the complete policy but always misses necessary fields, and adding more documents may not improve it. First make a baseline of prompts and structural constraints, and then determine whether there are sufficiently stable and representative examples to support fine-tuning. If you want to read the current data and output it stably, you can train it to use evidence while still carrying applicable data with each request.

Check information and behavior separately

Compare the base model, the base model plus data, the fine-tuned model, and the fine-tuned model plus the same data. Processing behavior is first compared under fixed correct evidence, and then the complete system is verified using real retrieval. The test includes updated facts, conflicts between knowledge stored in parameters and new evidence, missing evidence, denied access, and unseen wording; statistics on factual support, format, reasonable refusal, leakage, cost and delay are respectively carried out. Remembering the training set better does not prove generalization, and combinations only make sense if these dimensions fit the target.

Engineering deduction

scene
Teaching hypothesis: The enterprise customer service model has learned that "the unsubscription window is 7 days", the current information is changed to 14 days for a specific product, and fixed fields are required to be answered.
design decisions
Obtain unsubscribe conditions from credible and authorized current information to prompt the establishment of a baseline; if field omissions persist and there are sufficient examples, then use evidence-to-answer training to improve behavior.
Verify target
The acceptance goal is that the answer changes according to the conditions of the applicable version, the fields are complete, and the final conclusion is not made up by relying on old memory when evidence is missing.
applicable boundary
The case is a teaching design, the model has not been trained, and the actual benefits have not been measured; 14 days is a hypothetical value and does not represent the real product system.

Continuous questions and answers

Continue reading along with the premises and constraints of the problem. Understand the reference answers first, then try to put away the answers and explain the cause and effect and trade-offs in your own words.

Draw inferences from one example: If the conditions change, how to deduce it?

First find out the conditions for change, and then determine which premises in the original plan still hold true. The following cases are teaching deductions to facilitate the transfer of principles to new problems.

Stable work order classification

Changing conditions:The input contains all facts, the label set is stable for a long time, and there is no need to query dynamic knowledge.

Extended question:Each work order must be divided into fixed categories. Should we also build a knowledge base first?

Derivation and reference solutions

Start by establishing a baseline with clear label definitions and a small number of examples, checking for adjacent class boundaries and unknown classes. If the task volume is large, the input distribution is stable, and errors persist, fine-tuning can be evaluated using representative annotated data; retrieval only adds value when classification must rely on external rules. Test new wording and edge cases instead of just reusing training tickets, and re-evaluate when labeling rules change.

The principles that remain unchanged:Whether the input information is sufficient and whether the model processing behavior is qualified shall be judged separately; technical investment must be based on actual gaps.

Minute-level account status

Changing conditions:Knowledge becomes real-time structured state with per-user permissions

Extended question:The model has been fine-tuned to learn account information. Why do we still need tools to query the current balance?

Derivation and reference solutions

The training value can only describe past samples, and the current balance is calculated and read by the authoritative business system. The trusted server verifies the account scope and permissions, and the tool returns the time point, currency, and balance type; the model interprets the results but does not generate the amount from memory. RAG can assist in interpreting balance definitions and cannot replace real-time querying. After the user revokes the authorization, it prevents the tool from reading, and there is no need to train the model and forget a string of numbers to act as authentication. If sensitive facts have entered the shared parameters, blocking tools alone cannot prevent the model from reiterating old values. The affected model should be isolated or disabled and the leakage should be checked separately; fine-tuning and forgetting cannot be regarded as reliable access control.

The principles that remain unchanged:Parameters provide processing power, current facts and authorizations are provided by checkable external states, and behavioral training cannot replace them.

Easy to make mistakes

  • Treat pre-trained parameters as an authoritative data source that can be updated in real time and revoked item by item.
  • General claims that fine-tuning cannot learn facts, or that retrieving documents will guarantee correct answers
  • Replacing server-side authentication and data authorization with fine-tuned refusal behavior
  • Training and testing repeat system answers, mistaking memory samples for generalization ability

References

Designed based on original papers and official materials; the source supports training and retrieval mechanisms. Examples, questioning, scoring and experimental plans are designed for the teaching of this site and do not represent the original company interview questions or actual measurement results. New Q&A and migration cases are added for principle explanation, and source verification and case operation verification are recorded separately.

Check how far you understand

After reading, you can explain the principles, boundaries, and trade-offs against these standards. It is up to you to evaluate your mastery; if further verification is needed, complete the small tasks below.

Basic standards met
Able to distinguish between pre-training and fine-tuning, changing parameters, and general retrieval enhancements to provide evidence in requests.
Intermediate and advanced signals
Can locate bottlenecks based on data timeliness and output behavior, explaining that fine-tuning and RAG can be combined but cannot replace server-side authorization.
Senior criteria
Ability to design two-stage comparisons between fixed evidence and real systems, covering new facts, old memory conflicts, authority and cost boundaries.

Hands-on verificationComplete on demand · Suggestions15 minutes

Attribute the four types of failures "the policy has been updated but the model answers the old value", "the evidence is complete but fields are missing", "the current user revokes rights" and "stable classification without documentation", respectively, and design minimum comparisons.

Expand acceptance requirements and checkpoints
  • The method chosen directly addresses the lack of information or behavioral failure and does not treat the three techniques as equivalent options.
  • Make it clear that fact updates and permissions are obtained from trusted external states, and training rejections do not replace authorization.
  • Test new values, no evidence and unseen wording, fix evidence comparison behavior and check end-to-end results

Key inspections

  • Can distinguish between changing parameters during training and providing context during inference, and understand that the two can be combined
  • We don’t say that fine-tuning can only be about learning styles, nor do we say that RAG means automatically ensuring authenticity.
  • Ability to select methods based on missing information or failed behavior, and place the current authorization on the trusted server
  • Evaluate combination gains with independent testing and condition changes to avoid leakage of training answers