IMEN891K / IDSC501 / AXGS-501 · Data Engineering · Fall 2026

15. LLM Systems

Sangwoo Mo · POSTECH
Industrial & Management Engineering

Where We Are

Collection and PreparationPart I · Lec 2–5StoragePart II · Lec 6–13ML SystemsPart III · Lec 14LLM SystemsPart III · Lec 15AgentsPart III · Lec 16–17
Part III connects stored data to predictions, answers, and actions

Outline: LLM Systems

01Inputs and Evidencea question, the supplied material,and a candidate answer02Documents and Searchprepare readable pieces and findthe current rule03Answers and Checksconnect evidence to the answer andcheck support

The P-17 QuestionWhat is the pressure alarm threshold for P-17?

QuestionP-17 pressure alarm threshold?Answer5 bar? 7 bar? unknown?
The answer needs the current P-17 manual

01 · Inputs and Evidence

01Inputs and Evidencea question, the supplied material,and a candidate answer02Documents and Searchprepare readable pieces and findthe current rule03Answers and Checksconnect evidence to the answer andcheck support

Large Language ModelsA large language model (LLM) generates text from its input

Inputquestion + supplied textLLMgenerates textOutputcandidate answer
The input is visible; the generated answer still needs checking

Language Models: A Turning PointIn 2020, GPT-3 showed how task instructions and examples could guide one pretrained model

2020 · GPT-3: Language Models are Few-Shot LearnersInputtask instructiona few examplesPretrained modelno task-specific weight updateOutputresponse for this taskChanging the request is different from training a new model
The input can describe a task without retraining the model for each request

Question Without EvidenceA question alone does not supply the current manual

InputP-17 pressure alarm threshold?No manual text suppliedCandidate answer7 barno source to inspect
7 bar is an unsupported example answer

Question With EvidenceThe manual gives the model a source it can use

InputP-17 pressure alarm threshold?Manual: P-17 threshold is 5 barCandidate answer5 bar [p17-v4]source supplied
The supplied P-17 rule states 5 bar

PromptThe prompt is the input sent to the model

PROMPT: INPUT SENT TO THE MODELUse only evidence. Cite the source. Say unknown if missing.Question: P-17 pressure alarm threshold?Context: no manual text yet
Instructions and the question share one input

ContextContext includes the material supplied for this request

PROMPT: INPUT SENT TO THE MODELUse only evidence. Cite the source. Say unknown if missing.Question: P-17 pressure alarm threshold?Context: [p17-v4] P-17 pressure alarm threshold is 5 bar.
The manual text becomes part of the model input

Answer With a SourceA source reference lets a reader inspect the claim

Answer5 bar [p17-v4]p17-v4P-17 pressure alarm threshold is 5 bar.The source label gives the reader a place to check
5 bar points back to p17-v4

A Collection of ManualsThe collection contains similar rules for different cases

SourceTextEligibilityp17-v4P-17 pressure alarm threshold is 5 bar.Stop if pressure exceeds 5 bar.P-17, approvedp17-v2P-17 pressure alarm threshold is 7 bar.This obsolete version must not guide the current alarm.P-17, obsoletep18-v3P-18 pressure alarm threshold is 3 bar.This rule applies to P-18 only.P-18, approvedp17-vibrationP-17 vibration inspection: record vibration andtemperature before changing the operating speed.P-17, approved
P-17 has a current rule, an obsolete rule, and a neighbouring pump

02 · Documents and Search

01Inputs and Evidencea question, the supplied material,and a candidate answer02Documents and Searchprepare readable pieces and findthe current rule03Answers and Checksconnect evidence to the answer andcheck support

Why Document PreparationThe answer needs the rule and the equipment name together

Source tableFlattened textEquipmentThresholdP-175 barP-183 barP-17 P-18 5 bar 3 barWhich value belongs to P-17?Preserve row membership during extraction
A value without its row can describe the wrong pump

Loading the ManualLoading extracts readable text from the source

Manual pageEquipment: P-17Pressure alarm threshold: 5 barStop if pressure exceeds 5 barExtracted textP-17 pressure alarm threshold is 5 bar.Stop if pressure exceeds 5 bar.loading
The equipment name, value, and unit survive extraction

Document PiecesA chunk is a small piece that can be retrieved

p17-v4 / PressurePressure alarm threshold is 5 bar.Stop if pressure exceeds 5 bar.Use Celsius for temperature.splitchunk 0 / p17-v45 bar rule + stop conditionchunk 1 / p17-v4temperature unit
Each piece keeps a route back to its source

Caveat: Broken ConditionsA cut can separate an instruction from its condition

P-17 pressure alarm threshold is 5 bar. Stop if pressure exceeds 5 bar.bad boundaryStop if pressure exceeds5 bar.The instruction and its condition need to survive together
The stop instruction loses its threshold after a bad cut

Source LabelsA piece keeps its equipment and version alongside the text

TextP-17 pressure alarm threshold is 5 bar. Stop if pressure exceeds 5 bar.Sourcep17-v4EquipmentP-17Approvedyes
The text and its labels travel together

RetrievalRetrieval finds pieces related to the question

QuestionP-17 pressure alarm threshold?Candidate 1P-17 pressure rule: 5 barCandidate 2P-17 vibration inspection noteRelated pieces from the collection
A search returns evidence candidates rather than a finished answer

Embeddings: Text Becomes a VectorAn embedding represents text as numbers that can be compared

Embeddings: Text Becomes a Vector
Related meanings can have similar vectors even when their words differ

Store the Text Beside Its VectorThe stored vector helps find a piece while the text remains the evidence

Store the Text Beside Its Vector
Keep the original text so the answer can quote or cite its source

Search with the Question VectorEncode the question in the same way, then compare it with stored pieces

Search with the Question Vector
The selected vectors lead back to candidate source text

Caveat: Similar but WrongSimilar wording can belong to an obsolete rule

CandidateMatched textPolicy checkp17-v2pressure alarm threshold is 7 barobsoletep17-v4pressure alarm threshold is 5 barapprovedp18-v3pressure alarm threshold is 3 barwrong equipment
Both P-17 versions mention the same pressure question

Eligible EvidenceOnly approved P-17 sources can support this request

CandidateMatched textPolicy checkp17-v4pressure alarm threshold is 5 barapproved
The current rule remains after the equipment and approval checks

Demo: Find the ManualChange the request and approval filter, then inspect the returned source text

Local word-presence search, not a learned embedding or a model answer

Answer: Find the ManualThe baseline returns one pressure rule and one unrelated inspection note

p17-v4P-17 pressure alarm threshold is 5 bar.Stop if pressure exceeds 5 bar.p17-vibrationP-17 vibration inspection: record vibration and temperaturebefore changing the operating speed.
Only p17-v4 answers the pressure threshold question

03 · Answers and Checks

01Inputs and Evidencea question, the supplied material,and a candidate answer02Documents and Searchprepare readable pieces and findthe current rule03Answers and Checksconnect evidence to the answer andcheck support

Why Answer ChecksFinding the right source does not force the right answer

Retrieved source: p17-v4P-17 pressure alarm threshold is 5 bar.Candidate answer7 bar [p17-v4]
The source says 5 bar while the candidate says 7 bar

Evidence in the InputSelected text enters the prompt with its source label

QuestionWhat is the P-17 pressure alarm threshold?Selected evidence[p17-v4] P-17 pressure alarm threshold is 5 bar.Stop if pressure exceeds 5 bar.
The 5 bar rule reaches the model as p17-v4

Retrieval-Augmented Generation (RAG)A 2020 RAG paper connected document retrieval with text generation

QuestionP-17 threshold?Retrievep17-v4Inputquestion + textGenerate5 bar [p17-v4]
Retrieval-augmented generation connects the source to the answer

Checking the EvidenceDoes the selected text answer this question for this equipment?

SourceRetrieved textSupportp17-v4P-17 pressure threshold is 5 barAnswers the questionp18-v3P-18 pressure threshold is 3 barWrong equipmentp17-vibrationRecord vibration and temperatureNo pressure threshold
Current P-17 pressure text supports the requested value

Checking the AnswerDoes the cited text support the value and unit in the answer?

Candidate answerCited sourceCheck5 bar [p17-v4]p17-v4 states 5 bar for P-17Supported7 bar [p17-v4]p17-v4 states 5 bar for P-17Wrong value5 bar [p18-v3]p18-v3 states 3 bar for P-18Wrong source
The citation must support the claim beside it

Answer or AbstainMissing evidence calls for an explicit unknown

AnswerableP-17 pressure alarm threshold?Missing evidenceP-17 bearing replacement interval?5 bar [p17-v4]value and citation supportedunknownno interval in the supplied sources
No supplied document gives the bearing replacement interval

Case study: A Withdrawn ManualA document can disappear while its searchable copy remains

Source repositorySearchable chunksp17-v4: approved5 barp17-v2: withdrawnp17-v4 chunkscurrent evidencep17-v2 chunks: still searchableno removal
A withdrawn source can still leave searchable pieces

A Small Answer CheckTest the same path with a current, wrong-equipment, and missing-evidence question

QuestionAvailable evidenceExpected answerP-17 pressure threshold?P-17 approved rule: 5 bar5 bar [p17-v4]P-18 pressure threshold?P-18 approved rule: 3 bar3 bar [p18-v3]P-17 bearing interval?No interval in supplied sourcesunknown
One collection exposes the main ways this answer can fail

Takeaway: Answers need evidence that readers can check

1Put the material in the model input
2Retrieve complete pieces from the right current source
3Check the evidence and the answer; say unknown when evidence is missing
← → / Space · S notes · O overview · F fullscreen · number + Enter
Speaker notes