Skip to main content

Data formats and limits

What to upload​

A model is trained on a source: examples of what normal looks like. Save it with PUT /models/{id}/content as a string in source:

{ "source": "…", "candidates": "…" }

candidates is optional: sequences in the same format, scored against the fit when training finishes.

After a successful run the source and candidates are deleted and only the model is kept, unless you set keep_data on the model (API reference).

Encode each record as a list of integer token ids yourself; only numbers leave your system. Any of these work:

{"sequence": [3, 1, 4, 1, 5]} ← JSON Lines: one object per line
{"sequence": [2, 7, 1, 8, 2]}
[[3, 1, 4, 1, 5], [2, 7, 1, 8, 2]]
{ "sequences": [[3, 1, 4, 1, 5], [2, 7, 1, 8, 2]] }

At least 2 sequences, each at least 2 tokens. Ids are your own vocabulary: number them from 0 with no gaps — the vocabulary size is the largest id + 1, so sparse ids (say 0 and 100,000) cost as much capacity as 100,001 tokens.

These sequences are treated as independent records.

Groups of sequences (episodes)​

When your records come in groups — sentences in a paragraph, events in a session, lines in a document — upload them grouped:

{ "episodes": [
[[3, 1, 4, 1], [5, 9, 2]],
[[6, 5, 3], [5, 8, 9, 7]]
] }

Each inner list is one sequence (e.g. a sentence); each episode is a group (e.g. a paragraph). Besides how each sequence fits, the model then also learns how sequences within the same episode fit together. Still integers only.

Prose​

Upload documents as text, one string each:

{ "episodes": [
"The committee shall review the budget. The auditor may inspect the accounts.",
"Each party must protect the data unless the court orders disclosure."
] }

Each clause becomes a grammar frame — the same eight slots for every sentence, read from a dependency parse of the sentence (who did what to what), each value in its dictionary form:

SlotExample from "The committee shall review the budget."
subjectcommittee
modalshall
actionreview
objectbudget
target(noun after to/for/from/into/with/against/on/in)
modifier(the action's adverb, or the adjective after "is")
condition(the verb of an if/when/unless/until/before/after clause)
statusaffirmative / negated

A slot a clause doesn't fill is recorded as missing, so it counts too.

Each frame is a record and each document an episode, so the model learns how clauses are built and how the clauses of a document fit together. Frame values are fitted into the capacity automatically. Separate paragraphs with a blank line.

Know the trade-offs before choosing prose:

  • One frame per clause. Words outside those slots aren't used. In our test on 1960s English prose, a given word reached a frame in about one occurrence in five — prose suits judging how sentences are built, not individual words.
  • The text is processed on our servers (and deleted after training unless you set keep_data). To keep text on your side, encode it yourself and upload integer sequences.
  • Scoring prose offline needs the same text-to-frame encoding: use the text build of the portable scorer.
  • How well frames are read. On the held-out test set of the UD English Web Treebank (sentences whose main word is a verb), the parse finds the verb 87% of the time, the subject 81% and the object 66%; the word-tagging extractor prose models used before October 2026 found 58%, 58% and 53%. Models trained before then keep their extractor.

Records​

A JSON array of objects ([{"col": value, …}, …]), {"records": [...]} or {"rows": [...]}. Columns are encoded for you; numeric columns are binned. Every column is used when it fits the qubit budget (always, with role embeddings); otherwise the column with the most distinct values is left out first. The model lists the kept and dropped columns, and the source's SHA-256, under grammar.columns.

Limits​

LimitValue
Saved source or candidates8 MB each
Sequencesat least 2
Capacity (max_qubits)default 26, maximum 56

Vocabulary and capacity​

Any vocabulary fits. Values a candidate has that your source never had, and values a record is missing, each get a role of their own (missing, other), so they're scored rather than dropped.

Encodings​

How the model turns each role's value into a vector. Sizes are counted in qubits, the size a quantum encoding would need, but training runs on classical hardware. FidelityAI chooses for each training run; no setting is needed:

Exact indexRole embeddings (role_embedding_v1)
Used whenyour source's whole vocabulary fits the run's capacity (k = 2: 2 × ⌈log₂ v⌉ + 2 ≤ max_qubits), and its features keep at least half of your source's distinct records aparteither condition fails
Each valueits own exact state: values never blura small vector learned from your source: values used alike are similar
Qubitsk × ⌈log₂ v⌉ + 2Σ log₂(size of each role) + 2, whatever your vocabulary

Exact index gives each value its own state, but its features are only as wide as the qubit count, so when each record holds one tuple, many different records can share the same features (in one demo source, 192 distinct records became 4). Role embeddings keep those records apart, and keep a large vocabulary (prose, free text) whole instead of folding rare values together. Each training result reports exact_index_collapse, the share of distinct source records exact index keeps apart.

To choose for yourself, set the model's encoding: {"type": "exact_index"} keeps exact index even when it merges records, null returns to automatic, and role embeddings can be adjusted:

curl -s -X PUT $API/models/$MODEL -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' \
-d '{"encoding": {"type": "role_embedding_v1", "dim": 16, "one_hot_roles": [1]}}'
  • Roles are tuple positions. With k = 3 and records of exactly three tokens, each record is one tuple and its three positions are three roles.
  • dim (a power of two, 4–64) is the size of each role's vector; 16 is a good start. Tokens that appear with the same partners get similar vectors.
  • one_hot_roles lists positions whose values must never blur, such as labels: those get exact, separate states.
  • Qubits are Σ log₂(size of each role) + 2 — for dim 16, k = 3 and a 4-label role, 4 + 2 + 4 + 2 = 12 — whatever your vocabulary.
  • Changing these settings makes the next training a new run, even on the same source. A trained model keeps the encoding it was trained with.

How much data​

Every sequence is used to fit the model's boundary of "normal"; the discovery step that shapes the model looks at only a small sample of them. Training time grows with the number of sequences and steeply with capacity (qubits), so start with a few thousand sequences and add more only if scores on held-out data improve.

Duplicates are kept and count: a pattern that appears often pulls the model's idea of normal toward it, so upload your data at its real frequencies rather than de-duplicating it.

What k means for your encoding​

With k = 2 the fit sees pairs of adjacent tokens. A token's relationship to anything two or more positions away is only captured indirectly, so put tokens whose combination matters next to each other.

The model summarizes those pairs into a small number of features (one per qubit), grouping pairs by the model's own token order. Tokens that end up next to each other in that order — often your most frequent ones — can become indistinguishable.