Jev — mô hình quyết định System One— the System One decision model

Không sinh chữ. Trả về xác suất trên đúng tập đáp án bạn khai báo.

No text generation. A probability over exactly the answer set you declared.

LLM sinh token rồi bạn parse chuỗi đó thành quyết định. Jev nhận một khối state cùng các câu hỏi có kiểu, đánh giá tất cả song song trong một lượt, và trả về giá trị đã định kiểu kèm phân phối xác suất. Cái bạn mua không phải là JSON đẹp hơn, mà là một hợp đồng hẹp hơn giữa suy luận xác suất và phần mềm thường.

An LLM generates tokens and you parse that string into a decision. Jev takes a state plus typed questions, evaluates them all in parallel in one pass, and returns typed values with a probability distribution. What you buy is not prettier JSON — it is a narrower contract between probabilistic inference and ordinary software.

Một state, bốn câu hỏi chạy song song, mỗi câu trả về một phân phối One state, four questions evaluated in parallel, each returning a distribution state đọc một lần read once cho mọi câu hỏi for every question Khẩn cấp? Urgent? noul 0.96 Đội nào xử lý? Which team? eng .91 / other .09 Mức rủi ro? Risk level? score 1.88 · conf .74 Đã đủ thông tin? Complete? noul 0.07 một request one request một lượt truyền one forward pass

Nét đứt là các nhánh chạy song song và độc lập: câu hỏi này không nhìn thấy đáp án của câu hỏi kia. Thanh ngang là phân phối xác suất — với Choice và Score nó luôn cộng bằng 1. Với Noul, thanh chỉ biểu diễn một con số duy nhất từ 0 đến 1.

The dashed paths are independent parallel branches: no question sees another's answer. Each bar is a probability distribution — for Choice and Score it always sums to 1. For Noul the bar shows a single number between 0 and 1.

Chọn cái nào

Which one to use

Trước hết là câu hỏi hay bị bỏ qua: nhiều quyết định trong phần mềm không cần mô hình nào cả. Jev chỉ bắt đầu có lý khi tập đáp án đóng và biết trước, phán đoán cần hiểu ngôn ngữ tự nhiên, và khối lượng hoặc độ trễ đủ lớn để chi phí của LLM thành vấn đề.

First, the question most people skip: a great many software decisions need no model at all. Jev starts to make sense only when the answer set is closed and known up front, the judgment needs natural-language understanding, and volume or latency matters enough that an LLM's cost becomes the problem.

Điều kiện viết được bằng biểu thức, hoặc là số học, ngày tháng, so sánh chính xác?

Expressible as a condition, or a matter of arithmetic, dates, exact comparison?

Viết bằng code

Write it in code

Đúng 100%, không tốn tiền, không tốn mili-giây. Số học và ngày tháng là điểm yếu công khai của Jev.

100% correct, zero cost, zero latency. Arithmetic and dates are Jev's documented weak spot.

Cần chữ cho người đọc, hoặc cần một chuỗi suy luận nhiều bước?

Need prose for a human, or a multi-step chain of reasoning?

Dùng LLM

Use an LLM

Jev không được huấn luyện để sinh chữ, và mỗi câu hỏi của nó chạy độc lập nên không nối được thành chuỗi suy luận.

Jev is not trained to generate, and its questions run in isolation, so they cannot chain into reasoning.

Đáp án là đúng/sai?

Is the answer true or false?

noul

Một số từ 0 đến 1. Không có confidence, nên tự đặt hai ngưỡng và để khoảng giữa cho người duyệt.

One number from 0 to 1. No confidence, so set two thresholds and give the middle band to a human.

Đáp án là một trong N nhãn rời rạc?

Is the answer one of N discrete labels?

choice

Tối đa 255 option. Luôn thêm một option thoát kiểu other, vì nó luôn phải chọn ra người thắng.

Up to 255 options. Always add an escape option like other, because it always picks a winner.

Đáp án có thứ tự, và "ở giữa" là có nghĩa?

Is the answer ordered, with "in between" meaning something?

score

2 đến 10 mức. Dùng để so ngưỡng, không dùng để lấy ra một con số chính xác.

2 to 10 levels. Use it against a threshold, never to recover an exact quantity.

Câu hỏi đang gộp nhiều phán đoán vào một?

Does the question bundle several judgments?

Tách nhỏ

Decompose it

Hỏi tất cả trong cùng một request rồi gộp bằng công thức trong code. Tách nhỏ không tốn thêm round-trip.

Ask them all in one request and combine with a formula in code. Decomposing costs no extra round trip.

Confidence caoHigh confidenceChạy tự động.Act automatically.

Trung bìnhMediumHỏi lại người dùng, hoặc gắn cờ để rà.Confirm with the user, or flag for review.

ThấpLowĐừng hành động. Đẩy cho người, hoặc leo thang sang LLM suy luận.Do not act. Route to a human, or escalate to a reasoning LLM.

Bảy khái niệm, tra cứu nhanh

Seven concepts, for reference

Màu mã hoá họ khái niệm: xanh lam là cách đặt câu hỏi, xanh lục là cách đo độ tin cậy, tím là cách dựng hệ thống. Câu đánh đổi trong khung là cái giá bạn trả có ý thức — khác với mục "mất", vốn chỉ là khuyết tật.

Colour encodes the family: blue is how you ask, green is how certainty is measured, plum is how the system is built. The boxed sentence is the price you pay knowingly — different from "costs", which are merely defects.

noul

cách hỏiasking

Câu hỏi đúng/sai. Trả về một số từ 0 đến 1, đọc là xác suất mệnh đề đúng.

A true/false question. Returns one number from 0 to 1: the probability the statement is true.

noul 0.72 · không có confidenceno confidence field

  • Dùng choUse forLọc trước pipeline đắt, gác an toàn, kiểm tra tiền điều kiện, đếm bằng cách hỏi từng phần tử.Gating an expensive pipeline, safety screening, preconditions, counting one item at a time.
  • ĐượcGainRẻ nhất trong ba primitive; ngưỡng hoàn toàn do bạn đặt.The cheapest primitive; the threshold is entirely yours.
  • MấtCost0.5 vừa nghĩa là "đúng một nửa" vừa nghĩa là "không biết". Hai Noul ngược nhau không cộng thành 1.0.5 means both "half true" and "no idea". Two opposing Nouls do not sum to 1.

Chọn Noul là đổi con số confidence có sẵn lấy một xác suất trần trụi mà code tự định nghĩa ngưỡng và tự chịu trách nhiệm.

Choosing Noul trades a ready-made confidence number for a bare probability whose threshold your code defines and owns.

Dấu hiệu nhận biết: câu hỏi viết được thành một mệnh đề khẳng định, và bạn chỉ cần biết nó đúng tới mức nào.

How to spot it: your question can be written as a declarative statement and all you need is how true it is.

choice

cách hỏiasking

Chọn đúng một option trong tập bạn khai báo. Trả về option thắng, phân phối đầy đủ và confidence.

Picks one option from the set you declare. Returns the winner, the full distribution and confidence.

billing .88 / technical .12 · conf .81

  • Dùng choUse forĐịnh tuyến ticket, chọn tool, chọn model, xếp hạng lại, trích xuất bằng cách chọn trong các ứng viên.Routing tickets, picking tools or models, re-ranking, extraction as selection over candidates.
  • ĐượcGainSai schema là bất khả thi về cấu trúc; đổi danh mục option không cần train lại gì.Off-schema output is structurally impossible; changing the option set retrains nothing.
  • MấtCostLuôn có người thắng, kể cả khi không option nào đúng. Xác suất là tương đối, không phải "chắc chắn đúng".There is always a winner, even when nothing fits. The probability is relative, not "certainly right".

Chọn Choice là đổi khả năng nói "không cái nào đúng" lấy một phân phối luôn cộng bằng 1 mà code so sánh và đặt ngưỡng được ngay.

Choosing Choice trades the ability to say "none of these" for a distribution that always sums to 1 and that code can compare and threshold at once.

Dấu hiệu nhận biết: bạn viết được câu if với đúng các nhánh đó, và các nhánh loại trừ lẫn nhau.

How to spot it: you can already write the if with exactly those branches, and they are mutually exclusive.

score

cách hỏiasking

Chấm theo thang các mức có thứ tự. Trả về kỳ vọng có trọng số, nên nó rơi được vào giữa hai mức.

Rates against ordered levels. Returns a probability-weighted expectation, so it can land between levels.

score 1.05 · conf .92

  • Dùng choUse forMức nghiêm trọng, mức ưu tiên, mức rủi ro, chấm độ liên quan của passage trong RAG.Severity, priority, risk, grading passage relevance in RAG.
  • ĐượcGainCó thứ tự để sắp xếp và cắt ngưỡng; phân phối lộ ra kiểu phân vân.An ordering to sort and threshold on; the distribution exposes the kind of doubt.
  • MấtCostKhông khôi phục được con số thật: tài liệu nói thẳng hiệu chỉnh số học giữa các mức là yếu.You cannot recover a real quantity: the docs say numerical calibration between levels is weak.

Chọn Score là đổi độ chính xác số học lấy một thứ tự so sánh được và một ngưỡng duy nhất để cắt.

Choosing Score trades numerical precision for a comparable ordering and a single number to threshold on.

Dấu hiệu nhận biết: các đáp án có thứ tự tự nhiên, và "ở giữa hai mức" là một câu trả lời có nghĩa.

How to spot it: your answers have a natural order and "between two levels" is a meaningful answer.

confidence

cách đomeasuring

Hình dạng của phân phối quy về một số 0–1. Dồn một chỗ là chắc, trải đều là không chắc.

The distribution's shape collapsed into one 0–1 number. Concentrated is certain, spread out is not.

.40 / .33 / .27 · conf .10

  • Dùng choUse forChia ba đường xử lý, đặt ngưỡng riêng cho từng hành động theo mức thiệt hại, leo thang có chọn lọc.Three lanes of behaviour, a threshold per action sized to its cost, selective escalation.
  • ĐượcGain"Không biết" thành một trạng thái lập trình được; đổi mức tự động hoá chỉ bằng một hằng số."I don't know" becomes programmable; the automation rate moves by changing a constant.
  • MấtCostHiệu chỉnh là tính chất của cả nhóm dự đoán, không hứa gì về một câu trả lời cụ thể. Noul không có confidence.Calibration is a property of groups, promising nothing about one answer. Noul has none.

Chọn chặn theo confidence là đổi tỉ lệ tự động hoá lấy tỉ lệ sai thấp hơn trên phần đã tự động.

Gating on confidence trades automation rate for a lower error rate on the part you did automate.

Dấu hiệu nhận biết: sai ở tình huống này tốn kém hơn hẳn việc dừng lại hỏi.

How to spot it: being wrong here costs meaningfully more than stopping to ask.

calibration · RLCD

cách đomeasuring

Nói 0.8 thì đúng khoảng 80 lần trên 100 lần nói 0.8. Khác với accuracy, vốn đo từng câu.

Saying 0.8 means being right about 80 times out of the 100 times it says 0.8. Not the same as accuracy.

nói 0.80 → đúng ~0.80 trên cả nhómsays 0.80 → right ~0.80 across the group

  • Dùng choUse forMọi chỗ code phải quyết định có nên tin đáp án; làm đặc trưng đầu vào cho mô hình ML cổ điển.Anywhere code must decide whether to trust an answer; as features for a classical ML model.
  • ĐượcGainTự nhất quán cao nên ngưỡng không trôi theo cách diễn đạt; không fine-tune theo tài khoản.High self-consistency, so thresholds do not drift with phrasing; no per-account fine-tuning.
  • MấtCostKhông có lời giải thích để audit. Tiếng Anh tốt nhất; ngôn ngữ khác kém hơn theo chính tài liệu.No explanation to audit. English is best; other languages are weaker per the docs.

Chọn mô hình hiệu chỉnh là đổi lời giải thích có thể đọc được lấy một con số có thể đặt ngưỡng.

Choosing a calibrated model trades a readable explanation for a number you can threshold on.

Dấu hiệu nhận biết: bạn cần con số, không cần câu giải thích.

How to spot it: you need a number, not an explanation.

state

cách dựngbuilding

Khối ngữ cảnh mà mọi câu hỏi cùng nhìn vào. Chuỗi, JSON hoặc mảng văn bản — chỉ văn bản.

The context block every question looks at. String, JSON or array of text — text only.

64k token / request · 32k cho state + câu hỏi dài nhất64k tokens per request · 32k for state + longest question

  • Dùng choUse forTicket kèm đúng đơn hàng và đúng đoạn policy; trace tool-call; log hội thoại đã cắt gọn.A ticket with just the right orders and policy clause; a tool-call trace; a trimmed conversation log.
  • ĐượcGainNạp một lần dùng cho mọi câu hỏi; dữ liệu riêng đi qua state nên không cần fine-tune.Read once for every question; your private data rides in the state, so no fine-tuning.
  • MấtCostContext rot có thật. State bị coi là dữ liệu chứ không phải nội dung thù địch, nên văn bản cài lệnh lái được đáp án.Context rot is real. State is treated as data, not hostile content, so injected instructions can move answers.

Chọn nhét cả khối dữ liệu thô vào state là đổi độ chính xác và khả năng gỡ lỗi lấy việc khỏi phải viết tầng lọc ở code.

Dumping raw data into the state trades accuracy and debuggability for not writing a filtering layer in code.

Dấu hiệu nhận biết: bạn chỉ vào được từng trường và nói câu hỏi nào cần trường nào.

How to spot it: you can point at each field and say which question needs it.

fan-out

cách dựngbuilding

Mọi câu hỏi chạy song song và độc lập trên cùng state. Thêm câu hỏi gần như không làm tăng thời gian.

Every question runs in parallel and in isolation on the same state. More questions barely add time.

13 câu hỏi gộp một request: rẻ hơn 12.2× · nhanh hơn 10×13 questions in one request: 12.2× cheaper · 10× faster

  • Dùng choUse forTriage một ticket bằng chục câu hỏi cùng lúc; trả lời sẵn cả hai nhánh của một if rồi vứt nhánh thừa.Triaging a ticket with a dozen questions at once; pre-answering both branches of an if.
  • ĐượcGainXoá hẳn round-trip nối tiếp; phân rã phán đoán lớn thành câu nhỏ mà không trả giá về tốc độ.Serial round trips disappear; broad judgments decompose at no speed cost.
  • MấtCostĐộc lập nghĩa là không có suy luận nhiều bước: câu B không dùng được kết quả câu A.Independence means no multi-step reasoning: question B cannot use question A's answer.

Chọn hỏi đầu cơ là đổi vài nghìn input token rẻ lấy việc xoá hẳn một vòng round-trip trong đường đi của request.

Speculative fan-out trades a few thousand cheap input tokens for removing an entire round trip from the request path.

Dấu hiệu nhận biết: bạn đang định gọi mô hình lần thứ hai chỉ vì lần đầu chưa hỏi hết.

How to spot it: you are about to make a second call only because the first did not ask enough.

LLM vs Jev

LLM vs Jev

Hai thứ này không thay thế nhau. Jev lấy đi phần quyết định; LLM giữ phần sinh nội dung và suy luận dài. Trên bộ benchmark bốn workflow của chính TypeSafe, Jev đạt khoảng 68% accuracy — xấp xỉ LLM tầm trung, không vượt các mô hình mạnh nhất. Lợi thế nằm ở chi phí và độ trễ.

These are not substitutes. Jev takes the decision; the LLM keeps generation and long reasoning. On TypeSafe's own four-workflow benchmark Jev reaches about 68% accuracy — close to mid-tier LLMs, not ahead of the strongest ones. The advantage is cost and latency.

TrụcAxis LLM sinh chữGenerative LLM Jev
Đầu raOutput Chuỗi văn bản; JSON là văn bản trông giống JSONA string; JSON is text that looks like JSON Giá trị đã định kiểu kèm phân phối xác suấtTyped values plus a probability distribution
Cách lấy kết quảGetting the result Sinh token, parse, validate, retry khi hỏngGenerate, parse, validate, retry on failure Đọc trường trong responseRead a field on the response
Độ trễLatency Tỉ lệ với độ dài đầu ra: hàng trăm ms đến vài giâyScales with output length: hundreds of ms to seconds Tài liệu nói phần lớn quanh 100 ms; bên thứ ba đo 70–500 msDocs say most calls land near 100 ms; third parties measure 70–500 ms
Thêm một quyết địnhOne more decision Thêm token đầu ra, hoặc thêm một lần gọiMore output tokens, or another call Thêm một câu hỏi vào cùng request, gần như không tăng thời gianOne more question in the same request, barely any extra time
Chi phíCost Tính cả input và output; output thường đắt hơnInput and output; output usually costs more $0.042 / Mtok input, output miễn phíinput, output free
Ra ngoài schemaOff-schema output Có thể xảy ra; cần validate và retryPossible; needs validation and retries Bất khả thi về mặt cấu trúcStructurally impossible
Tín hiệu độ tin cậyTrust signal Không có sẵn; độ tự tin viết trong văn bản chỉ là lời nóiNone built in; stated confidence is just words probabilities và confidence được hiệu chỉnhCalibrated probabilities and confidence
Giải thíchExplanation Viết được chuỗi lý luậnCan write out its reasoning Không có gì để đọc ngoài con sốNothing to read but the number
Suy luận nhiều bướcMulti-step reasoning CóYes Không; mỗi câu hỏi độc lậpNo; every question is independent
Sinh nội dungGeneration CóYes Không, hoàn toàn khôngNo, not at all
Đầu vàoInput Thường đa phương thứcUsually multimodal Chỉ văn bảnText only
Kiểu sai điển hìnhTypical failure Bịa nội dung, lệch schema, quả quyết quá mứcFabrication, schema drift, overconfidence Chọn sai một giá trị hợp lệ, đọc quá sát mặt chữPicking the wrong valid value, reading too literally
Tiếng ViệtVietnamese Nhiều mô hình mạnh đều tốtStrong models handle it well Kém hơn tiếng Anh theo chính tài liệu; phải tự đo trước khi tinWeaker than English per the docs; measure before trusting

Sai lầm hay gặp

Common mistakes

Phần lớn lấy từ trang "jaggedness" do chính TypeSafe công bố cho bản jev-1.13 — đáng đọc trước khi triển khai thật.

Most of these come from TypeSafe's own jaggedness page for jev-1.13 — worth reading before you ship.

Sai lầmMistake Vì sao saiWhy it fails Sửa thế nàoDo this instead
Hỏi "có bao nhiêu X trong đoạn này"Asking "how many X are in this passage" Mô hình nhận dạng hình dáng câu trả lời chứ không đếm; sai số tăng theo kích thướcIt recognises the shape of an answer rather than tallying; error grows with size Một Noul cho mỗi phần tử, cộng ở codeOne Noul per item, summed in code
Hỏi ngày nào trước ngày nàoAsking which date comes first Ngày được đọc như chữ, không như đại lượng có thứ tựDates are read as text, not as ordered quantities Trích từng thành phần bằng Choice, ghép và so sánh ở codeExtract parts with Choice, assemble and compare in code
Nội suy score để lấy ra con số thậtInterpolating score to recover a real number Hiệu chỉnh số học giữa các mức yếuNumerical calibration between levels is weak Chỉ dùng score để so ngưỡngUse score only against a threshold
Nhét cả tài liệu vào state cho chắcDumping a whole document into the state Context rot: chi tiết không liên quan kéo độ chính xác xuống và làm khó gỡ lỗiContext rot: irrelevant detail costs accuracy and hides the cause of errors Lọc ở code, hoặc lọc trước bằng một Noul về độ liên quanFilter in code, or gate with a relevance Noul first
Một câu hỏi lớn kiểu "cái này có ổn không"One broad question like "is this okay" Giấu nhiều phán đoán sau một con số, không tinh chỉnh được phần nào cảSeveral judgments hide behind one number and none can be tuned Tách thành câu nguyên tử, gộp bằng công thức trong codeSplit into atomic questions, combine with a formula in code
So noul với probabilities["yes"] của một ChoiceComparing noul with a Choice's probabilities["yes"] Hai thang khác nhau: Choice là tương đối, Noul là tuyệt đốiDifferent scales: Choice is relative, Noul is absolute Chọn một kiểu hỏi và tinh chỉnh ngưỡng riêng cho nóPick one form and tune its threshold separately
Giả định P(A) + P(không A) = 1Assuming P(A) + P(not A) = 1 Hai Noul riêng không có ràng buộc số học nào với nhau; tài liệu đưa ví dụ tổng ra 1.19Two separate Nouls carry no arithmetic relationship; the docs show a pair summing to 1.19 Hỏi đúng một chiều, đừng suy ra chiều còn lạiAsk one direction and do not infer the other
Tin state do người dùng gửi lênTrusting user-supplied state State là dữ liệu và không được coi là thù địch; văn bản cài lệnh lái được đáp ánState is data and is not treated as hostile; injected instructions can move the answer Thêm một câu hỏi về prompt injection, viết criteria chặt, test kỹ trước khi mởAdd an injection check, write tight criteria, test hard before opening it up
Dùng jev-latest cho ngưỡng đã tinh chỉnhUsing jev-latest behind tuned thresholds Alias dịch chuyển khi có bản mới: đáp án đổi mà code không đổi dòng nàoThe alias moves on release: answers change without a line of your code changing Ghim jev-1.13.0 và nâng cấp theo lịch của bạnPin jev-1.13.0 and upgrade on your own schedule

Ba câu cần nhớ

Three things to remember

  1. Jev không sinh chữ: nó trả về giá trị đã định kiểu và phân phối xác suất trên đúng tập đáp án bạn khai báo, nên không còn gì để parse và không thể lệch schema.Jev does not generate text: it returns typed values and a distribution over exactly the answer set you declared, so there is nothing to parse and nothing can land off-schema.
  2. Giá trị lớn nhất không nằm ở tốc độ mà ở chỗ "tôi không chắc" trở thành một con số lập trình được — code của bạn mới là thứ quyết định khi nào được tự động hành động.The biggest gain is not speed but that "I'm not sure" becomes a programmable number — your code, not the model, decides when automatic action is allowed.
  3. Đổi lại, bạn mất khả năng sinh nội dung và suy luận nhiều bước, và nhận về một mô hình đọc rất sát mặt chữ, yếu về số học, tốt nhất với tiếng Anh.In exchange you lose generation and multi-step reasoning, and you get a model that reads very literally, is weak at arithmetic, and works best in English.