Back to Mattra

Mattra-1 · in training

How we are building a legal model for each market

Mattra-1 is being fine-tuned now. It is not a general chatbot with a legal prompt: it is a family of models, one per market, trained on local law and served from our own GPU servers. This page shows how we are building it, where we are and what it takes to run.

~70Bparameters in the base model
1,128 GBof GPU memory per server, 8× H200
0requests to public AI models, by design

How Mattra-1 will answer

Every answer will pass five stations. The model will never answer from memory alone.

  1. Question

    In English, Thai or Arabic, with or without a document.

  2. Retrieval

    The current text of the relevant laws and rulings is pulled from our index.

  3. Mattra-1

    The market model writes the answer from those passages only.

  4. Verifier

    A separate model checks that each cited article exists, is in force and supports the claim.

  5. Answer

    Delivered with citations. Anything unconfirmed is removed or flagged.

Where we are

We started from an open-weight model we can host ourselves and are teaching it the law of one market at a time. Thailand and the UAE come first.

  1. 01Done

    Choose an open-weight base

    We chose a multilingual model of about 70 billion parameters for its Thai and Arabic. Open weights mean it runs entirely on our hardware.

  2. 02In progress

    Build the legal corpus

    We are collecting codes, acts, decrees, gazettes and court decisions for Thailand and the UAE, cleaned and versioned by amendment date.

  3. 03In progress

    Continued pre-training

    The base model is reading the corpus to learn legal language in Thai and Arabic: how statutes are drafted and how courts reason.

  4. 04In progress

    Fine-tuning with lawyers

    We are preparing question-and-answer examples with practising lawyers. They teach the answer format: conclusion, article cited, and "no rule found" when nothing fits.

  5. 05Next

    One base, one adapter per market

    Market knowledge will live in lightweight adapters (LoRA) on a shared base. Adding Malaysia will mean training a new adapter, not a new model.

  6. 06Next

    Evaluation before every release

    Before the pilot opens wider, each version will sit an exam of real questions per market, scored by lawyers, plus citation-accuracy tests.

Why fine-tuning and retrieval together

Each technique fixes a different failure. Only the combination fixes all four.

ApproachLocal legal languageCurrent lawChecked citationsData stays private
General chatbot with a legal promptPartlyNoNoNo
Retrieval on a public modelPartlyYesNoNo
Mattra-1: fine-tuned, grounded, verifiedYesYesYesYes

What it takes: memory, compute, power

A legal model is heavy because legal documents are long. These are the engineering estimates we are planning around for a 70B-class model.

Where GPU memory goes on one server

8× H100 · 640 GB~45 long sessions at once
8× H200 · 1,128 GB~90 long sessions at once
Model weights, 70 GBLong sessions, about 10 GB eachReserve, 10%

A long session is a 32,000-token context, about 50 pages of contract. Weights are stored in FP8. Working memory per token for a 70B model with grouped-query attention:

2 × 80 layers × 8 KV heads × 128 × 2 bytes ≈ 0.33 MB/token → × 32,000 tokens ≈ 10 GB

~6 s

Target speed

for a typical answer with retrieval and citation checks

<1 GB

Adapter size

per market, so several markets share one server

~11 kW

Power

per server with cooling, about 96,000 kWh a year

Training jobs: plan and status

JobDataHardwareEstimated timeStatus
Continued pre-training, per market~2B tokensRented cluster, 64× H100~10 hours (~600 GPU-hours)In progress
Fine-tuning a market adapter~50M tokensOwn server, 8× H200~2 hours per runIn progress
Refresh after law changes~10M tokensOwn server, 8× H200Under 1 hourNext
Updating the legal indexNew gazette textsOwn serverMinutes, dailyNext

Full pre-training needs more memory than one server holds, so it runs on a rented cluster with public legal texts only. Everything that will touch client data runs on our own servers.

Private by architecture

Weights on our hardware

The model and its adapters will run on servers we own, in a closed environment.

No outbound AI calls

Questions and documents never leave the environment for a third-party model.

Client data never trains the model

Training uses public law and lawyer-written examples only.

Encrypted and deletable

Documents are encrypted at rest and deleted on request.

Join the Mattra-1 pilot

We are opening the pilot to a small group of law firms and businesses in Thailand and the UAE. Leave your work email to test early versions on your own documents.

We reply within one business day.