/ Модель

Характеристики

Контекст
262 144 токена
Размер весов
18,8 ГБ
Лицензия
Apache 2.0
Архитектура
qwen3_5 · dense
Базовая модель
Qwen3.5-9B
Библиотека
transformers
Опубликована
29 сен 2026

xll-regulations-qwen3.5-9b

Генерация текстаТекст → текст3 профессии
177скачиваний за 30 дней1лайквеса обновлены18 ноя 2026

Описание модели

Составлено на русском по карточке модели и метаданным Hugging Face

Полноразмерная дообученная Qwen3.5-9B преобразует разделы федеральных нормативных актов США в структурированное дерево XLL в JSON с привязкой к исходному тексту.

XLL Regulations Qwen3.5-9B — разработанная Thurston Powers полноразмерная дообученная версия Qwen/Qwen3.5-9B для преобразования разделов федеральных нормативных актов США в структурированное дерево XLL в JSON с привязкой узлов к исходному тексту. Модель предназначена для извлечения структуры нормативного раздела, а не для общего диалога, преобразования в USLM XML или обработки законодательных актов.

Для работы требуется передавать текст в специальном формате разреженного лексического индекса и использовать обученный системный промпт и шаблон сообщений. Модель возвращает JSON с тегами, диапазонами символов, атрибутами и дочерними узлами. Контракт требует точного исходного текста и детерминированной сборки, проверки результата и человеческого контроля. Модель основана на плотной архитектуре Qwen3.5 с 9 млрд параметров; веса BF16 доступны в safetensors. При оценке использовался контекст 32 768 токенов и генерация до 8 192 новых токенов.

На зарезервированной выборке из 158 разделов автор сообщает 93,7% точного совпадения с допуском различий в пробелах и 92,4% строгого совпадения. Выборка охватывала только разделы заголовков 5, 12 и 27 и не содержала примеров с таблицами, поэтому эти результаты не подтверждают качество на других заголовках или таблицах. Лицензия — Apache-2.0.

Сценарии применения

  • Построение структурного дерева XLL по разделу федерального нормативного акта США
  • Выделение разделов и вложенных элементов регулирования с диапазонами исходного текста
  • Преобразование нормативного текста в JSON для последующей проверки и обработки
  • Подготовка структурированных данных нормативных актов для поиска и анализа

Ограничения

Модель не рассчитана на подачу обычного текста: необходимы специальный разреженный индекс, точный системный промпт и шаблон сообщений. Оценка охватывает ограниченный набор заголовков без таблиц, а результат требует валидации и проверки человеком.

Публичные бенчмарки

Результаты из открытых лидербордов в сравнении с лидерами каталога

Публичных оценок пока нет

В подключённых источниках результатов этой модели не нашлось. Отсутствие оценки не значит, что модель хуже: её могли просто не проверять.

Источники: Hugging Face Leaderboards, Hugging Face Eval Results, Open LLM v2, MTEB, timm, Open ASR, EvalPlus, LLM Stats

Бенчмарки пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь рядом с другими моделями теста

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы по шкале 0–100.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

XLL Regulations Qwen3.5-9B

Task-specialized full-language fine-tune for converting federal regulation sections into source-aligned XLL structural JSON. It is not a general-purpose competitor to frontier models, not the statutes adapter, and not standalone USLM XML. Intended value is faithful conversion with smaller deployment requirements; best cost-effectiveness and serving throughput have not been measured.

Availability: the retained BF16 full-fine-tune weights are in this repository, together with the trained prompt, a training example, and the evaluation evidence.

Base model and loading contract

Base: Qwen/Qwen3.5-9B, revision c202236235762e1c871ad0ccb60c8ee5ba337b9a. This candidate is a full-language model, not a LoRA adapter. Its protocol is raw-text-cfr-source-native-structure-0.2, prompt variant cfr-native-lexical-sparse-v2-regulations.

Use the exact trained system prompt and message encoding illustrated in example.json, a training example, not heldout evidence. User input consists of sparse start:end|JSON-string lexical fragments; unlisted characters are ASCII spaces. Offsets are zero-based, end-exclusive Unicode character positions. Output is {"tree":[tag,start,end,attributes,children]}. Do not replace the trained interface with an arbitrary plain-text prompt. Deterministic assembly, validation and human review remain required.

How to run inference: required indexed input

This model does not accept plain regulation text. At training and evaluation time the user message was a lossless sparse lexical index of the source section. Passing raw text, or applying output offsets to the indexed message, is outside the trained contract and should not be expected to reproduce the reported accuracy. The output is a tree whose spans index the original raw text.

System prompt

Use this frozen prompt byte-for-byte (also distributed as PROMPT_TRAINED.txt):

Convert raw federal regulation text to a source-native USLM tree. Return only {"tree":[tag,start,end,attributes,children]}. Every child has the same five-field shape. Root is the complete section. Spans are zero-based Unicode character offsets, end exclusive, not tokens. Children are ordered, nonoverlapping and contained within parents. All text is copied from spans, not regenerated. Preserve num, heading, chapeau, content, continuation, notes, references, inline markup, tables and hierarchical provision types. Attributes are a JSON object of string keys and string values; children is an array, possibly empty. Use namespace aliases {"g": "http://schemas.gpo.gov/xml/uslm", "h": "http://www.w3.org/1999/xhtml", "u": "http://xml.house.gov/schemas/uslm/1.0", "xml": "http://www.w3.org/XML/1998/namespace"}. Input fragments are start:end|JSON-string. Unlisted character positions are ASCII spaces; all other whitespace is explicitly listed. Fill the unlisted positions with spaces to recover the exact text of the stated length. Fragment boundaries do not indicate XML boundaries. Return JSON only, with no explanations. Predict only text-grounded attributes value, date, type, role, topic, status, and table attributes colspan, rowspan, scope, span when evidenced by the input. Omit external identifiers, link destinations and presentation attributes. Keep CFR paragraph nesting and source/authority/editorial elements distinct.

Do not add a role wrapper, a schema description, or Markdown fences.

User message

The user content is a header line followed by one fragment per line:

Document type: regulations. Text length: <N> Unicode characters.
<start>:<end>|<JSON string>
...

start is inclusive and end exclusive; both are zero-based Unicode character offsets into the original raw text. The fragments cover every non-ASCII-space character. Any position not listed is an ASCII space (U+0020). Non-ASCII whitespace, including no-break space (U+00A0) and narrow no-break space (U+202F), is listed explicitly. The | separator is followed by a JSON string with ensure_ascii=True; decode it with a JSON parser, do not strip quotes.

import json
import re

FRAGMENT = re.compile(r'\s+|\w+|[^\w\s]')

def encode(raw, document_type='regulations'):
    assert document_type == 'regulations'
    fragments = [
        f'{m.start()}:{m.end()}|{json.dumps(m.group(), ensure_ascii=True)}'
        for m in FRAGMENT.finditer(raw)
        if m.group().strip(' ')          # omit ASCII-space-only runs only
    ]
    header = (f'Document type: {document_type}. '
              f'Text length: {len(raw)} Unicode characters.')
    return header + '\n' + '\n'.join(fragments)

Encode the exact text you want the spans to refer to. Do not normalize, collapse, strip, or re-wrap it first. raw is a Python str; len(raw) counts Unicode code points.

Example for the fictional text § 1. Example rule.:

Document type: regulations. Text length: 18 Unicode characters.
0:1|"\u00a7"
2:3|"1"
3:4|"."
5:12|"Example"
13:17|"rule"
17:18|"."

Chat template and decoding

system_prompt = ...  # the exact text above
messages = [
    {'role': 'system', 'content': system_prompt},
    {'role': 'user', 'content': encode(raw, 'regulations')},
]
input_ids = tokenizer.apply_chat_template(
    messages, tokenize=True, add_generation_prompt=True,
    enable_thinking=False,
)

Load the full fine-tune with Qwen/Qwen3.5-9B at revision c202236235762e1c871ad0ccb60c8ee5ba337b9a. Use BF16, greedy decoding (do_sample=False), and no grammar or output repair. The evaluated runtime used a 32,768-token context, at most 8,192 new tokens, and JSON-object stopping. Reject inputs that do not fit; do not truncate them.

Reading the output

Parse exactly one JSON object of the form {"tree":[tag,start,end,attributes,children]}. Spans are zero-based, end-exclusive Unicode offsets into the original raw text, not into the encoded user message. The root span must be [0, len(raw)]; children are ordered, non-overlapping, and contained in their parent. Validate the tree and retain human review. A syntactically valid JSON object is not necessarily a valid or correct tree.

Training

  • 5,000 sections: 2,792 GPO-derived gold and 2,208 deterministic eCFR silver.
  • Two epochs, 2,500 optimizer updates, effective batch four; seed 102301.
  • Learning rate 5e-6; Adafactor; 125-step warmup, cosine decay to 0.1 of peak.
  • Full language parameters trained; vision frozen. FP32 training parameters, BF16 compute; retained checkpoint is BF16 safetensors.
  • 32,768-token training context, without truncation; longest example 26,455 tokens.
Target XML nodesGoldSilverTotal
1–108456611,506
11–259196931,612
26–50612373985
51+416481897

Training includes 15 gold and 82 silver table-bearing sections. Silver is a deterministic conversion, not human-reviewed gold. Source diversity does not establish correctness on all titles. Training report and inventory record the recipe and counts.

Reserved validation — distinct from development

On a score-blind selected, token-eligible 158-section reserved slice, the retained candidate achieved 148/158 (93.7%) whitespace-tolerant exact, 146/158 (92.4%) strict exact, and 158/158 native-valid. Train/development overlap was checked by IDs, groups and substantial passages; remaining limitations are documented with reserved evidence.

This slice has only titles 5, 12 and 27; no eligible tables; node-bin counts 35/50/49/24. It has fewer high-complexity examples than development200. Do not compare the overall percentages directly or infer table/general-title performance. It is now consumed validation, not untouched data for future recipe selection.

Complexity-balanced development evaluation

Frozen 200-section model-selection/development set, not an untouched test estimate. Success requires a native-valid tree, identical hierarchy/tags and supported attributes, and corresponding spans equal after stripping outer whitespace. Interior whitespace is preserved. This is target-aware reconstruction, not complete USLM XSD validation, and differs from the statutes card's schema-gated structural metric. Percentages across the two model series are not interchangeable.

MetricCountRate
Whitespace-tolerant joint exact127/20063.5%
Strict joint exact115/20057.5%
Native tree valid179/20089.5%
Hierarchy and labels exact137/20068.5%
Target XML nodesSectionsExact successNative-valid
1–103533/35 (94.3%)35/35
11–255040/50 (80.0%)50/50
26–504928/49 (57.1%)45/49
51+6626/66 (39.4%)49/66

Success by structural complexity

Complexity counts target XML nodes, including inline markup and XHTML; it is not legal difficulty. Lines connect ordinal-bin rates, not fitted trends. Of the 73 failed development sections, 61 are above 25 nodes and 40 are in the 51+ bin. Table-bearing sections: 13/30 exact (43.3%), 16/30 native-valid (53.3%). Without tables: 114/170 exact (67.1%), 163/170 native-valid (95.9%). Invalid trees and structural errors remain significant deployment risks.

Task comparison and frontier caveats

These are same-cohort original shared-prompt results, not a demonstrated best-prompt frontier comparison. Unlike the statutes series, no clarified-prompt regulation rerun is available here; it would require a separate experiment.

ModelSectionsWhitespace-tolerant exactNative-valid
Retained full fine-tune200127/200179/200
Selected LoRA200101/200179/200
GPT-6 Sol — original shared prompt2000/200183/200

GPT-6 Sol produced 183/200 native-valid trees and 14/200 matching hierarchies, but zero supported-attribute-exact outputs, hence zero joint-exact outputs. Zero exact success does not imply no useful structure or inferior general legal ability. It received the same frozen prompts via OpenRouter, reasoning disabled, provider- default sampling and an 8,192-token output cap. Prompt suitability, tokenization, stopping and runtime differences limit the comparison. This is not an optimized frontier benchmark or a general intelligence ranking. No output repairs are used.

Appendix: partial vanilla, matched IDs only

Vanilla completed only a nonrandom 126-section prefix on RTX 5090; it is not a complete/hardware-matched 200-section baseline. All models below are restricted to those same 126 IDs; do not mix these denominators with the full200 results.

ModelMatched sectionsWhitespace-tolerant exactNative-valid
Retained full fine-tune12680/126121/126
Selected LoRA12661/126117/126
GPT-6 Sol — original shared prompt1260/126114/126
Vanilla — partial RTX 50901260/1260/126

Matched partial vanilla comparison

Runtime and reproducibility

Local evaluation uses BF16 without quantization, greedy batch-one generation, 32,768-token context, at most 8,192 new tokens, and JSON-object stopping. Retained and LoRA candidates were evaluated on NVIDIA GB10; partial vanilla on RTX 5090. Evaluation used Transformers 5.15.1 and PyTorch 2.13.0+cu130. Quantized variants and every consumer GPU/context combination are not qualified. BF16 weights are roughly 18 GiB before activation/cache overhead.

Development/complexity evidence includes counts, title/table provenance, report and prediction hashes, and partial-baseline caveats. Reserved validation and training report are separate evidence. Weights status records the uploaded shard hashes and the verified Hub revision. SHA256SUMS.json covers the documentation artifacts published in this commit.

Selection, limitations, and license

The retained mixed5000, two-epoch seed-102301 candidate is not automatically replaced by later recipes. Development selection is not an unbiased test estimate. No complete training corpus or development predictions are packaged. Supported attributes are restricted; opaque metadata, full USLM schema compliance and legal accuracy are not claimed. Whole titles, oversized sections, OCR/PDF input, arbitrary state conventions and long-context/quantized deployment are not validated. Use official source text as authoritative; review all model-generated structure.

Apache-2.0; the base-model license is included as LICENSE.

Replication dataset

Training and evaluation data: thurstonpowers/xll-regulations-dataset. Use the model-specific contract and splits described in the dataset card.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen3_5ForConditionalGeneration
Ревизия весов
8cdf344

0 моделей