How doesNQ work?

The model runs in your browser. Search runs on the Kutup server, and every sentence of the answer is checked against the source it cites.

Open NQ ↗

How a question gets its answer

Four steps: the server searches, the browser filters the passages, the model writes, and every sentence is compared with its source.

In your browserKutup serverOutside service
  1. Question

    You type the question in the browser.

    In your browser
  2. Search

    Word and meaning search. The browser makes the question vector.

    4,213 records · 4,213 meaning vectors

    In your browserKutup serverOutside service
  3. Relevance gate

    Each candidate gets a 0–1 score. Below 0.3, or below 0.35 × the best, it never reaches the model; the best must reach 0.5.

    In your browser
  4. Is the evidence enough?

    There are three paths.

    Enough: the model writesPartly: it writes and names the missing partNot enough: the answer says so
    In your browser
  5. Web search (optional)

    Up to 3 targeted queries on Brave Search. The server fetches pages and picks passages.

    In Auto it asks first; in Web + verify it always runs.

    Kutup serverOutside service
  6. The model writes

    Kutup NQ, 0.6 billion parameters, writes the answer in one pass.

    In your browser
  7. Sentence check

    Each sentence is compared with the passage it cites.

    In your browser
  8. Answer

    The cited answer and the Checks tab.

    In your browser

The question goes to the Kutup server for search. The model and the answer stay in your browser.

Step 1 · Finding candidate passages

The Kutup server searches two ways: records that share the question’s words (BM25) and records that mean the same thing (vector search). The two ranked lists are merged into one.

wordRRFmeaning1. A3. A2. B4. C1. C2. D3. E5. EA 32.3C 32.0E 31.3B 16.1D 16.1
Example ranks. The middle numbers are formula (5) × 1000: a passage ranked well in both lists moves ahead; one found by a single list (dashed) falls back.
Technical detail

Word search: BM25 over each record’s body, title and keywords. For each query word q:

BM25(d)=∑q∈Qwqidfqtfq,d\mathrm{BM25}(d) = \sum_{q \in Q} w_q \, \mathrm{idf}_q \, \mathrm{tf}_{q,d}tfq,d=fq,d(k1+1)fq,d+k1(1−b+b|d|/|d|‾)\mathrm{tf}_{q,d} = \frac{f_{q,d} \, (k_1 + 1)}{f_{q,d} + k_1 \left( 1 - b + b \, |d| / \overline{|d|} \right)}
idfq=ln(1+N−nq+0.5nq+0.5)\mathrm{idf}_q = \ln\left( 1 + \frac{N - n_q + 0.5}{n_q + 0.5} \right)
score(d)=g(d)·(0.45+0.55cov(d))\mathrm{score}(d) = g(d) \cdot \left( 0.45 + 0.55 \, \mathrm{cov}(d) \right)g(d)=1−e−BM25(d)/|Q|g(d) = 1 - e^{-\mathrm{BM25}(d) / |Q|}

g squashes raw BM25 into 0–1; cov(d) is the share of the question’s words found in the record. The result is not a probability.

fq,df_{q,d}
times q occurs in the body; +3 if it is in the title or keywords
wqw_q
question word 1; nine fixed aliases (e.g. kestirimci → predictive) 0.25
k1,bk_1,\; b
BM25 saturation and length settings 1.2 · 0.75
N,nqN,\; n_q
records in the dataset; records containing q
|d|,|d|‾|d|,\; \overline{|d|}
record length in words; its mean

Meaning search: the browser turns the question into a 384-dimensional unit vector with multilingual-e5-small (prefix “query: ”; records were encoded beforehand with “passage: ”). The server scores every record vector by cosine similarity; record vectors are stored in 8 bits with one scale per row:

cos⁡(q,d)=q·(sdvd)‖q‖\cos(\mathbf{q}, d) = \frac{\mathbf{q} \cdot (s_d \, \mathbf{v}_d)}{\lVert \mathbf{q} \rVert}sd=maxj|xd,j|127s_d = \frac{\max_j |x_{d,j}|}{127}vd,j=round⁡(xd,jsd)v_{d,j} = \operatorname{round}\left( \frac{x_{d,j}}{s_d} \right)

Fusion: the two lists are merged by reciprocal rank fusion (RRF). Ranks are added rather than scores, so two different scales become comparable:

RRF(d)=∑ℓ∈{BM25,cos}1k+rℓ(d)\mathrm{RRF}(d) = \sum_{\ell \in \{\mathrm{BM25}, \cos\}} \frac{1}{k + r_\ell(d)}
rℓ(d)r_\ell(d)
rank of d in list ℓ (from 1); the term is 0 if d is not in the list
kk
constant; softens the gap between top ranks 60
SettingValueNote
BM25 keep≥ max(0.10, 0.55 · top)at most 8 per dataset
Merge5 per datasetTurkish question: Turkish datasets ×2.0, others ×0.92; English question: Turkish ×0.88, others ×1.12
Cosine floor0.80at most 12 meaning hits
Candidate pool24by RRF order
Index4,213 × 3844-byte scale + 384 bytes per row

Source NQ/backend_php/src/retrieval.php · NQ/backend_php/src/dense_search.php · NQ/backend_php/router.php · NQ/frontend/src/js/local/helpers-core.js

Step 2 · The relevance gate

Every passage found is read together with the question by a small reranking model in the browser and scored from 0 to 1. Weak passages never reach the model; if the evidence is not enough, the answer says so.

00.51ABCDEFrelevanceenough 0.50.35 × bestkeep 0.3
Example scores. Filled bars reach the model (at most 3); D clears 0.3 but stays under 0.35 × best (0.32).
Technical detail

The cross-encoder in the browser (mMiniLMv2 mMARCO) reads each (question, passage) pair together and outputs one logit; a sigmoid turns it into a 0–1 score. For multi-part questions each part is scored too and the highest is taken; web results are multiplied by their source type:

r(q,d)=σ(z)=11+e−zr(q, d) = \sigma(z) = \frac{1}{1 + e^{-z}}
sd=wd·max(r(q,d),maxpr(qp,d))s_d = w_d \cdot \max\left( r(q, d),\; \max_{p} r(q_p, d) \right)
keep(d)⇔sd≥max(0.3,0.35smax)\mathrm{keep}(d) \iff s_d \ge \max\left( 0.3,\; 0.35 \, s_{\max} \right)

s_max: the highest score among the candidates. At most 3 passages are kept, highest first; headlines separately, at most 2 (threshold 0.3).

zz
the cross-encoder’s logit
qpq_p
one part of the question (2–3-part questions)
wdw_d
source weight: library 1; on the web manufacturer 1, standard 1, reference 0.92, other 0.85, forum 0.72

Three outcomes: if the best score reaches 0.5 and every part is covered, the model writes; if only some parts are covered, it writes and names the missing parts; otherwise the answer says the evidence is not enough and offers a web search. A part counts as covered when its own best passage reaches 0.5.

SettingValueNote
Normal thresholds0.30 · 0.35 · 0.50keep · ratio · enough
Strict thresholds0.45 · 0.50 · 0.60after a reader disputes an answer
Candidates10 + 6passages + headlines

Source NQ/frontend/src/js/local/controller.js · NQ/frontend/src/js/local/helpers-core.js

Three source settings

What is usedLibraryAuto
default
Web + verify
Kutup recordsAlwaysAlwaysAlways
Wikipedia, newsWhen neededWhen neededWhen needed
Web searchNoAsks if shortAlways
Sentence checkEvery on-device answerEvery on-device answerEvery on-device answer

Wikipedia and news are added when the library returns fewer than 8 results or the question calls for them. Sentence check runs on every on-device answer once the helper models are loaded.

A web result’s relevance score is multiplied by its source type’s weight

  • Manufacturer documentation1.00
  • Standards bodies1.00
  • Reference sites0.92
  • Other sites0.85
  • Forums0.72

Step 3 · The model writes

The answer is written by Kutup NQ, Qwen3-0.6B with every weight retrained: 28 identical blocks, 596 million parameters. It runs in your browser with wllama.

outputembedding×28blocks
The model, top to bottom: input, 28 blocks, output. Every block has the same structure.
Attention16 query heads8 key/value heads, each shared by two queriesFeed-forward1024 → 3072 → 1024102430721024
One block. Attention shares 8 key/value heads among 16 query heads (grouped-query attention).
596 M parameters28 blockshidden size 1024head size 128vocabulary 151,936trained context 40,960base: Qwen/Qwen3-0.6B
Technical detail: one block

Each block is two sub-layers with residual connections. Normalisation is RMSNorm, attention has 16 query and 8 key/value heads (GQA, head size 128, positions by RoPE), the feed-forward is SwiGLU:

h=x+Attn(RMSNorm(x))\mathbf{h} = \mathbf{x} + \mathrm{Attn}\left( \mathrm{RMSNorm}(\mathbf{x}) \right)y=h+FFN(RMSNorm(h))\mathbf{y} = \mathbf{h} + \mathrm{FFN}\left( \mathrm{RMSNorm}(\mathbf{h}) \right)
Attni=softmax⁡(QiKg(i)⊤128+M)Vg(i)\mathrm{Attn}_i = \operatorname{softmax}\left( \frac{Q_i K_{g(i)}^{\top}}{\sqrt{128}} + M \right) V_{g(i)}g(i)=⌊i/2⌋g(i) = \lfloor i / 2 \rfloor

M is the causal mask that hides later tokens; query head i uses key/value head g(i).

FFN(x)=W3(SiLU(W1x)⊙W2x)\mathrm{FFN}(\mathbf{x}) = W_3 \left( \mathrm{SiLU}(W_1 \mathbf{x}) \odot W_2 \mathbf{x} \right)SiLU(z)=zσ(z)\mathrm{SiLU}(z) = z \, \sigma(z)

W₁ gate, W₂ up and W₃ down projections; ⊙ is element-wise product.

p(·∣x≤t)=softmax⁡(Eyˆt)p(\cdot \mid x_{\le t}) = \operatorname{softmax}\left( E \, \hat{\mathbf{y}}_t \right)

ŷ_t: RMSNorm of the last block’s output at position t. The output reuses the embedding table E (tied weights).

SettingValueNote
Blocks · hidden · feed-forward28 · 1024 · 3072
Query / key-value heads16 / 8 · 128head size
RoPE θ1,000,000trained context 40,960 tokens
Parameters596 M28 × 15.7 M per block + 155.6 M embedding

Source Qwen/Qwen3-0.6B config.json · NQ/local/model/*.gguf

Technical detail: writing

Writing goes token by token. Temperature is 0, so the most likely token is chosen at every step; logits of tokens already used are weakened by 1.05 (repeat penalty):

xt+1=argmaxvz˜vx_{t+1} = \arg\max_{v} \tilde{z}_v
z˜v=zv1.05(zv>0)\tilde{z}_v = \frac{z_v}{1.05} \;\; (z_v > 0)z˜v=1.05zv(zv≤0)\tilde{z}_v = 1.05 \, z_v \;\; (z_v \le 0)

Only for tokens v already in the context; other logits are unchanged.

SettingValueNote
Context window1,536prompt and answer together
Longest answer380tokens
Temperature · top-k · repeat penalty0 · 40 · 1.05top-k has no effect at temperature 0
Source length700 · 520 · 420most characters for [1], [2], [3]; headlines as [R1], [R2]
KV cacheq8_0 · flash attentionCPU threads when WebGPU is missing

Source NQ/frontend/src/js/local/llm.js · NQ/frontend/src/js/local/prompt.js

Step 4 · Sentence check

Every sentence of the answer is compared with the passage it rests on. Supported sentences stay, unproven ones are marked, and contradicted ones or ones that lean on the wrong source are removed. A small inference model does the comparison.

[1]

PLC/SCADA logs and hidden aliasing

[2]

Stamp time at the source

  1. The arrival time of a packet is not the time of the event [2].

    supported

    Source 2 says so.

  2. This difference makes the sampling rate deviate from the Nyquist criterion [1].

    removed

    It leans on source 2’s point, but cites [1], which does not support it.

  3. A PLC failure is directly tied to the source time stamp [2].

    removed

    Contradicted by source 2.

supportedunverifiedremoved
Technical detail

The natural-language inference (NLI) model gives a (passage, sentence) pair three logits; softmax turns them into probabilities. A cited sentence is paired with the passages it cites, an uncited one with every passage:

(pe,pn,pc)=softmax⁡(ze,zn,zc)(p_e, p_n, p_c) = \operatorname{softmax}(z_e, z_n, z_c)

e: entailment, n: neutral, c: contradiction.

e=maxPpe(P,s)e = \max_{P} p_e(P, s)c=minPpc(P,s)c = \min_{P} p_c(P, s)
w=maxP|K(s)∩K(P)||K(s)|w = \max_{P} \frac{|\mathrm{K}(s) \cap \mathrm{K}(P)|}{|\mathrm{K}(s)|}

K: the set of stems; a stem is the first 5 letters of a word of 5+ letters. The small NLI model misses paraphrased lists, so word overlap counts too.

The verdict, in this order:

  1. supported — e≥0.6e \ge 0.6 or (if no back-link) (e≥0.35∧w≥0.6)∨(w≥0.8∧c<0.4)(e \ge 0.35 \wedge w \ge 0.6) \vee (w \ge 0.8 \wedge c < 0.4)
  2. contradicted → removed — c≥0.75∧e<0.2c \ge 0.75 \wedge e < 0.2
  3. wrong link → removed — the sentence leans on the previous one (“therefore”, “in this step”), shares no cited source with it, and w<0.6w < 0.6
  4. unverified → marked — everything else; removed in strict mode

Sentences under 25 characters, tables and quotes are not checked. The check runs only when the helper models are loaded and writing was not stopped. Whether each figure in the answer appears in the sources is shown separately in the Checks tab.

Source NQ/frontend/src/js/local/controller.js · NQ/frontend/src/js/local/helpers-core.js

Helper models

Meaning search

Question and record vectors, 384 dimensions

intfloat/multilingual-e5-small

38.7 MB · int8 · MIT

Relevance

A 0–1 score for each candidate

cross-encoder/mmarco-mMiniLMv2-L12-H384-v1

38.9 MB · int8 · Apache-2.0

Verification

Support or contradiction between a sentence and its passage

MoritzLaurer/multilingual-MiniLMv2-L6-mnli-xnli

28.0 MB · int8 · MIT

All three run with onnxruntime-web (WebAssembly) in a browser worker. Kutup did not train them; they are separate from the answer model.

  • Vocabulary pieces, before250,002
  • Vocabulary pieces, after42,910

What full fine-tuning changed

Kutup NQ is not a LoRA add-on: all 596 million weights were retrained on cited answers written by a larger teacher model (a full fine-tune).

Full fine-tuneKutup NQ was trained this way: all 596 M weights were updated.
LoRAFor comparison: base weights stay frozen and only thin added matrices are trained.
  1. A Questions7 question types × 4,213 records
  2. B PromptsThe site’s own search and passage code
  3. C Answers12,957 training, 411 held out. A flawed answer is regenerated at most twice, then dropped.
  4. D TrainingAll weights; 3 epochs, best at epoch 2
  5. E Held-out check409 of 411 questions passed the checks
  6. F ExportGGUF, Q4_K_M; importance matrix on 691 chunks
AdamW · learning rate 2e-5 · cosine scheduleEffective batch 32 (8 × 4 accumulation)fp32 master weights · bf16 mixed computeLoss on answer tokens onlyUp to 1,536 tokens · 3% held out
02e-50123epochlearning ratebest: epoch 2
The learning rate drawn from the formula used in training: 3% warm-up, then cosine to zero. Held-out loss was lowest after epoch 2 (0.918); that checkpoint is used.
Technical detail

Each example is a prompt (question + numbered sources) and the teacher’s answer. The loss is computed on answer tokens only; prompt tokens are masked:

ℒ(θ)=−1|A|∑t∈Alogpθ(xt∣x<t)\mathcal{L}(\theta) = -\frac{1}{|A|} \sum_{t \in A} \log p_\theta(x_t \mid x_{<t})
η(s)=ηmaxssw\eta(s) = \eta_{\max} \frac{s}{s_w}η(s)=ηmax2(1+cosπu)\eta(s) = \frac{\eta_{\max}}{2} \left( 1 + \cos \pi u \right)u=s−swS−swu = \frac{s - s_w}{S - s_w}

First the warm-up (s < s_w), then the cosine (s ≥ s_w). s is the step, S the total steps, s_w = 0.03·S.

AA
positions of answer tokens
θ\theta
all of the model’s weights (596 M)
ηmax\eta_{\max}
peak learning rate 2e-5
SettingValueNote
OptimiserAdamWweight decay 0.01 · gradient clipping 1.0
Batch8 × 4 = 328 per device, 4 accumulation steps
Length1,536tokens, most per example
Epochs3best epoch 2, held-out loss 0.918
Precisionfp32 + bf16fp32 master weights, bf16 compute
Data12,957 / 411train / held out; teacher Qwen3.5-35B-A3B

Source dev/nq_local/colab/d_train.py · NQ/local/model/model.json

What it learned and how it behaves

  • 77words, median answer
  • 95%of answers cite a source
  • 409 / 411held-out questions passed the checks
  • 1,536token context window, in the browser
  • 380most answer tokens
  • 0temperature: the most likely token at every step
  • Writes with citations to the numbered sources: [1], [2], [3]; headlines as [R1]. It learned this in training; the prompt holds no separate rule. Sentences that disagree with their source are removed afterwards by the sentence check.
  • If the evidence gate is not passed, the model does not run at all; the answer says the evidence is not enough.
  • For multi-part questions, it names any part without a source.
  • Writes in the detected language of the question (Turkish or English; the interface language if unsure).
  • Format: numbered steps, lists, tables and highlight lines. NQ turns them into visual blocks.
  • If a reader says an answer is wrong, the question is answered again with strict thresholds (0.45 · 0.5 · 0.6), and unproven sentences are removed instead of marked.

Size and quality

Quantisation stores the weights in fewer bits: the file shrinks and perplexity rises a little. The browser downloads the Q4_K_M file, about 397 MB.

  • bf16perplexity 11.591,142 MiB
  • Q8_0perplexity 11.61609 MiB
  • Q5_K_Mperplexity 11.84423 MiB
  • Q4_K_Mperplexity 12.08the browser downloads378 MiB
Technical detail
PPL=exp(−1N∑i=1Nlogp(xi∣x<i))\mathrm{PPL} = \exp\left( -\frac{1}{N} \sum_{i=1}^{N} \log p(x_i \mid x_{<i}) \right)

Measured on held-out answers in 1,024-token windows. Lower means the model predicts the text better.

The Q4_K_M file uses 5.32 bits per weight on average (above 4.5 because the embedding table stays in Q6_K). Its perplexity is 4.2% above bf16. Quantisation used an importance matrix (imatrix): on 691 chunks of training examples, each weight’s effect on the output was measured and rounding error was kept small where it matters.

Source dev/nq_local/colab/f_export.sh · NQ/local/model/model.json

On device or in the cloud?

On deviceCloud
Where is search?Kutup server (word and meaning search); the question vector is made in the browserKutup server
Who writes the answer?The Kutup NQ local model (0.6 billion parameters), in the browserA larger cloud model (OpenRouter)
First useThe model (397 MB) and helper models (107 MB) download once, then open from the cacheNo download
SpeedDepends on your device; fast with WebGPU, otherwise CPU threadsUsually fast; needs the network
LimitServer search quota: 60 an hour, 300 a day. Web search: at most 20 requests an hour per visitor and 300 a day for the whole site.10 messages an hour, 20 a day

Limits

  • The checks measure format and source agreement on 411 held-out questions. They do not measure whether an answer is engineering-correct.
  • A small model can reason wrongly. Sentence check reduces this; it does not catch every error. It does not run before the helper models load or when writing is stopped.
  • Even at temperature 0, the WebGPU and CPU paths can give the same question a different answer through small numerical differences.
  • Verify critical settings with vendor documentation, the site procedure and a qualified engineer.
  • In cloud mode and with web search, do not share confidential plant data, passwords or personal data.
  • The validation questions were written alongside the content; they are not independent field-accuracy measurements.

Terms used on this page

BM25
A classic search score based on matching words: the more often a question word appears in a record, and the rarer that word is overall, the higher the score; long records are slightly penalised.
Vector (meaning) search
Turning text into a vector of numbers where texts with similar meaning land close together, then finding the nearest vectors. It also finds the same question asked in different words.
RRF reciprocal rank fusion
A way to merge several ranked lists by rank rather than score: 1/(60 + rank) is summed over the lists.
Reranking (cross-encoder)
A model that reads the question and a passage together and scores their relevance. Slower than vector search but more accurate, so it is used only on a few candidates.
Natural-language inference (NLI)
Classifying the relation between two texts: does one support the other (entailment), contradict it, or neither (neutral).
Sigmoid
The S-shaped function that maps any number into 0–1: σ(z) = 1/(1 + e^(−z)).
Importance matrix (imatrix)
A table, measured on sample text, of which weights affect the output most. Quantisation keeps rounding error small on those weights.
Token
The smallest piece of text a model reads and writes: a word, part of a word or a punctuation mark. Qwen3’s vocabulary has 151,936 rows.
Parameter (weight)
One of the numbers a model learns in training. “0.6 billion parameters” means the model is made of that many numbers.
Transformer block
The repeating layer of the model: attention (each token looks at earlier tokens), then a feed-forward network. Blocks are stacked; each refines the representation of the text a little more.
Attention
How a token weighs which earlier tokens matter to it. Formula: softmax(QKᵀ/√d)·V.
Grouped-query attention GQA
Attention in which several query heads share one key/value head. In Qwen3-0.6B, 16 query heads share 8 key/value heads, which halves that memory.
Embedding table
The table that turns each token into a vector of numbers (here 1,024 per row). In Qwen3-0.6B the same table is reused at the output (“tied” weights): the next token’s score is the dot product of the last hidden state with these rows.
Logit and softmax
A logit is an option’s raw score. Softmax turns these scores into probabilities that add up to 1: pᵢ = e^{zᵢ} / Σⱼ e^{zⱼ}.
Temperature
The number (T) that divides the logits before softmax. T = 0 picks the most likely token at every step (greedy decoding), so the same question gives the same answer. In a decision head, T is tuned so the probabilities match real hit rates (calibration).
Full fine-tune
Updating every weight of a pre-trained model on new data. The model itself changes; nothing is bolted on.
LoRA Low-Rank Adaptation
A training method that freezes the base weights and adds the product of two small matrices to each matrix (W₀ + BA). It is cheaper but leaves the base model as it was. Kutup’s models were not trained this way.
Cross-entropy loss
The negative logarithm of the probability the model gave the correct next token. The higher that probability, the smaller the loss; training pushes this number down.
AdamW
An optimiser that steps each weight using running averages of its gradients and of their size, and applies weight decay separately.
Cosine schedule
A learning rate that, after a short warm-up, falls towards zero along a cosine curve.
bf16 and fp32
Number formats. fp32 is 32-bit (precise), bf16 is 16-bit (fast, coarser). In training the master copy of the weights is kept in fp32 and the maths runs in bf16, so small updates are not rounded away.
Epoch
One full pass of the training data through the model.
Held-out set
Examples never used in training, kept aside only for testing. They show whether the model generalises rather than memorises.
Teacher model
The larger model that writes the training data. The small model (the student) learns from its answers; this is called distillation.
Quantisation
Storing the weights in fewer bits (e.g. about 4–6 instead of 16). The file gets smaller and faster; quality can drop slightly.
Q4_K_M llama.cpp k-quant
A llama.cpp quantisation mix. Most weights are Q4_K: 4-bit values in 32-weight sub-blocks of 256-weight super-blocks, each sub-block with a 6-bit scale and minimum (4.5 bits per weight). A few sensitive tensors (e.g. half of the attention-value and feed-forward output matrices) stay in Q6_K.
Perplexity
How “surprised” a model is by a text: the exponential of the mean cross-entropy. On the same text, lower perplexity means closer to the full-precision model.
GGUF
llama.cpp’s model file format. Besides the weights it carries key–value metadata (architecture, vocabulary, chat template and, in Baud, the decision head and shape grammars).
llama.cpp and wllama
llama.cpp is an open-source C/C++ engine that runs language models on CPUs and GPUs. wllama is llama.cpp compiled to WebAssembly so it runs in a browser (Kutup serves version 3.8.1 from its own server).
WebAssembly and WebGPU
WebAssembly lets a browser run compiled code at close to native speed. WebGPU lets a browser compute on the graphics card; the model uses it when it is available.