> For the complete documentation index, see [llms.txt](https://docs.quantaria.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quantaria.xyz/product/how-it-works.md).

# How It Works

A Quantaria model is a stack of tensor-network layers that turns a text prompt or image patches into generated text or images. This page follows one request from input to output.

{% hint style="info" %}
Hilbert-1 Nano and Base run on GPUs. Quantum hardware is not part of the serving path today. See [Quantum Path](https://github.com/bhavy2908/dataai_docs/tree/main/architecture/quantum-path.md).
{% endhint %}

## 1. You send a prompt

You use a Hilbert-1 model through the [Quantaria Console](https://github.com/bhavy2908/dataai_docs/tree/main/overview/quantaria-console.md). You choose Nano or Base, then request text or an image.

## 2. Input becomes tokens and patches

Text is split into tokens. Images are handled as patches. Nano accepts up to 2K tokens of text context and Base up to 8K.

## 3. One backbone processes both

Both modalities pass through the same set of shared tensor cores. The backbone was trained with a [Transfusion-style objective](https://github.com/bhavy2908/dataai_docs/tree/main/architecture/multimodal-backbone.md): next-token loss on text, diffusion loss on image patches.

## 4. Each layer is a tensor-network contraction

Inside the backbone, each weight layer is an MPO ([Tensor-Network Weights](https://github.com/bhavy2908/dataai_docs/tree/main/architecture/tensor-network-weights.md)). Instead of multiplying by one large dense matrix, the model contracts the input with a chain of small cores. Bond dimensions (χ) were set by rank-adaptive training, and cores are kept in canonical form for stable contraction.

## 5. Attention uses a factorized cache

Attention uses Tensor Product Attention, which factorizes queries, keys and values and keeps a smaller KV cache than standard attention. Hilbert-1 Base adds an MPO mixture-of-experts, where experts share a central tensor.

## 6. Output

* **Text** is generated token by token.
* **Images** are generated through the diffusion process: 32×32 for Nano and 256×256 for Base.

## What stays the same, what changes

| Part             | Standard transformer  | Quantaria                         |
| ---------------- | --------------------- | --------------------------------- |
| Weights          | Dense matrices        | MPS/MPO cores from step zero      |
| Text and images  | Often separate models | One shared backbone               |
| Attention cache  | Full keys and values  | Tensor Product Attention          |
| Quantum hardware | Not applicable        | Research path for selected layers |

## Related

* [Features](/product/features.md)
* [Models](https://github.com/bhavy2908/dataai_docs/tree/main/overview/models.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.quantaria.xyz/product/how-it-works.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
