/ Модель

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

Лицензия
Apache 2.0
Базовая модель
Qwen3.8-27B
Опубликована
3 окт 2026

Qwen3.8-27B-Solidity-v1-GGUF

Генерация текстаТекст → текст

Дообученная на данных аудита модель Qwen для поиска уязвимостей в Solidity-контрактах и составления отчётов о найденных проблемах.

445скачиваний за 30 дней0лайковвеса обновлены3 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

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

Qwen3.8-27B-Solidity-v1 — модель Rami8612 для анализа безопасности смарт-контрактов на Solidity. Это причинная языковая модель с гибридной архитектурой, сочетающей линейное внимание и полное внимание; она получена дообучением Qwen3.8-27B с помощью LoRA, после чего адаптер объединён с весами. Репозиторий содержит версии GGUF, включая варианты квантования, и safetensors.

Модель предназначена для аудита кода контрактов: поиска уязвимостей уровня High и Medium и подготовки результатов с указанием причины, пути атаки, влияния и исправления. По README, дообучение выполнено на примерах аудитов и реальных эксплойтов; на тестовом наборе из 191 контракта модель показала F1 0,54 против 0,44 у базовой модели, однако на 37 эксплойтах 2026 года результаты заметно различались между вариантами квантования. Данные обучения не опубликованы. README сообщает о запуске рекомендованного GGUF-варианта с контекстом 128k на одной видеокарте с 32 ГБ памяти; сам этап дообучения использовал контекст 25 600 токенов. Модель принимает текст кода и выдаёт текстовый отчёт. Лицензия — Apache-2.0.

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

  • поиск уязвимостей High и Medium в Solidity-контрактах
  • подготовка отчёта аудита с причинами и путями атаки
  • оценка влияния уязвимости и предложение исправления
  • первичная проверка контрактов DeFi перед аудитом
  • анализ кода контрактов, связанных с реальными эксплойтами

Ограничения

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

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

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

Открыть на Hugging Face

Qwen3.8-27B-Solidity-v1

  • +23% F1 over the base model and +20% over DeepSeek V4 Pro (1.6T MoE, ~60× larger) on 191 held-out smart contracts.
  • +49% precision over the base model: fewer false accusations, less noise per contract.
  • Built from 3,225 Solidity contracts, 413 professional audits and 3,987 judged findings (2,998 training examples; the rest held out for testing).
  • Custom imatrix GGUF mix (Q4_K_Mix): 43% less divergence than Q4_K_M + imatrix, and runs with 128k context on a single 32 GB GPU.

Benchmark comparison: this model vs Qwen3.8-27B base vs DeepSeek V4 Pro

A LoRA fine-tune of Qwen3.8-27B trained on Solidity smart-contract audit data, so that it handles smart contracts better than the base model. The data combines findings from professional smart-contract security audits and analyses of real-world exploits, linked to the vulnerable contract code. The repo also contains a quantization study with custom imatrix-guided GGUF mixes, built to run the model on a single 32 GB V100.

Dataset in numbers (train + held-out validation/test):

  • 3,225 Solidity contract files, each paired with its expected audit result: 2,998 for training, the rest held out for validation and test.
  • 413 professional security audits of DeFi protocols.
  • 3,987 judged High/Medium findings, each with root cause, attack path and fix, linked to the vulnerable code.
  • 58 real-world exploits, with the victim contracts' verified source code.
  • 560 clean contract files: in-scope files with no valid High/Medium finding after judging.
  • 595 step-by-step reasoning traces from DeepSeek V4 Pro, kept only when they reached the same findings as the human auditors.
  • About 13M tokens of training text.

This is a personal end-to-end project covering dataset construction, LoRA training, evaluation against the base model and a frontier model, quantization, and testing on real hardware.

Model details

Developed byRami8612
Model typeCausal language model, hybrid architecture (linear + full attention), LoRA fine-tune merged into the weights
Fine-tuned fromunsloth/Qwen3.8-27B
DomainSolidity / EVM smart contracts
LanguageEnglish (general Spanish ability preserved)
FormatsGGUF (custom imatrix mixes and standard quants) + LoRA adapter
LicenseApache-2.0
Versionv1 (2026-10-03)
Codegithub.com/Rami8612/Qwen3.8-27B-Solidity-v1

Results at a glance

On a held-out test set of 191 contracts (split by protocol, so no project appears in both train and test), compared with the base model and DeepSeek V4 Pro, a 1.6T-parameter MoE model (49B active), about 60× larger than this 27B model:

vs. Qwen3.8-27B base (27B)vs. DeepSeek V4 Pro (1.6T MoE, 49B active)
F10.44 → 0.54 (+23%)0.45 → 0.54 (+20%)
Precision37% → 55% (+18 pts, +49%)46% → 55% (+9 pts)
Recall (strict)53% → 53% (same)43% → 53% (+10 pts)
Findings per contract2.37 → 1.88 (−21%, less noise)1.17 → 1.88

On 37 real exploits from 2026 (incidents that happened after every model's training cutoff), F1 went from 0.37 (base) and 0.44 (DeepSeek) to 0.49 with the recommended quant (+32% vs base, +11% vs DeepSeek). The plain Q4_K_M build reached 0.58. With only 37 samples, differences of a few points may be noise.

General skills were mostly preserved: Spanish Q&A stayed at 16/16, and Python coding problems with tests went from 15/16 to 14/16.

Training

Base modelunsloth/Qwen3.8-27B (bf16 release of Qwen3.8-27B). Hybrid architecture: 48 linear-attention + 16 full-attention layers
MethodLoRA bf16 with Unsloth + TRL SFT (r=16, alpha=16, lr 1e-4 cosine, effective batch 8, 2 epochs, 750 steps), loss on responses only
Context25,600 tokens
Data2,998 examples: High/Medium findings from professional security audits (2022–2025) linked to the code, real-world exploit analyses, 515 clean-code negatives (17%), and 595 reasoning traces generated with DeepSeek V4 Pro (MIT) and filtered by rejection sampling
Hardware1× H100 NVL 94 GB, 3 h 55 min, peak VRAM 70.9 GB
Eval loss1.325 (base) → 0.834 (final), no overfitting

Each training example is one contract file plus the expected findings: title, severity, location, root cause, attack path, impact and fix. The training data is not published.

Training data

Data typeDescriptionExamples (all splits)
Audit findingsJudged High/Medium findings from professional security audits, linked to the audited contract files2,607
Real-world exploitsPost-mortem analyses of real exploits, plus the victim contract's verified source code58
Clean contractsAudited, in-scope files with no valid High/Medium finding; "hard" negatives preferred (files whose reported issues were judged invalid)560
Reasoning traces595 step-by-step traces generated with DeepSeek V4 Pro (MIT) for thinking-mode examples, kept only when they reached the same findings as the human auditors—
  • Totals: 2,998 train / 36 validation / 191 test examples, split by protocol (305 / 9 / 60 protocols), so that no project appears in more than one split.
  • Train size: about 13M tokens.
  • Audit dates: 2022–2025.
  • 2026 exploit test set: all 37 exploits from 2026 are kept in test only.

Evaluation details

Audit benchmark: 191 contracts, no thinking

The metrics are automatic and location-based. Precision is how many of the flagged functions are the real bug. Recall is how many of the real bugs are flagged.

ModelSizePrecisionRecallF1Flags clean codeFindings/contract
Qwen3.8-27B base (UD-Q4_K_M)16.5 GB37%53%0.4494%2.37
DeepSeek V4 Pro (API)1.6T params (MoE, 49B active)46%43%0.4577%1.17
This model, A: Q4_K_M16.8 GB54%48%0.5197%2.13
This model, Q4_K_M-imat (B)16.8 GB56%49%0.5286%2.10
This model, Q4_K_Mix-imat (I)18.7 GB55%53%0.5489%1.88

Real 2026 exploits: 37 incidents

ModelPrecisionRecallF1
Base (UD-Q4_K_M)26%60%0.37
DeepSeek V4 Pro45%43%0.44
This model, A: Q4_K_M56%60%0.58
This model, Q4_K_M-imat (B)50%60%0.54
This model, Q4_K_Mix-imat (I)43%57%0.49

Thinking mode: 60 contracts, 20k-token budget

RunFinished reportF1
Base, thinking14/600.12
This model, thinking51/600.39
This model, no thinking60/600.53

After fine-tuning, thinking mode finishes far more often than in the base model. It still scores worse than answering directly.

Quantization study

The imatrix was computed from a custom calibration set: Solidity 50%, Foundry tests 15%, ERCs 10%, Python 10%, Go/Rust 5%, Spanish 10%. KLD was measured against the BF16 model on six domains (lower = more faithful to the full-precision model).

VersionGBMean KLDSame top-1 token
A: Q4_K_M16.80.026393.2%
B: Q4_K_M + imatrix → Q4_K_M-imat16.80.017994.1%
C: generic mix14.50.057090.2%
G: custom mix v118.10.012695.0%
I: custom mix v2 → Q4_K_Mix-imat18.70.010295.0%
D: Q5_K_M + imatrix → Q5_K_M-imat19.50.007295.6%
E: Q6_K + imatrix22.40.002296.8%
F: Q8_029.00.000798.4%

Quantization: file size vs mean KLD against BF16

How mix I (Q4_K_Mix-imat) is built:

  • Q6_K on every sensitive tensor (ffn_down, attn_qkv, ssm_out, attn_output, attn_v, output).
  • Q5_K on ffn_up/gate of the most important layers by imatrix statistics (51–63).
  • Q4_K with imatrix on everything else.

At about 11% more size than Q4_K_M, it has 43% less divergence than Q4_K_M + imatrix.

Lessons learned:

  • Adding --tensor-type rules on top of Q4_K_M shifts its internal "more bits" heuristic and silently drops some Q6_K tensors to Q4_K. Every sensitive tensor needs an explicit rule.
  • Pushing the least important layers down to Q3_K to pay for upgrades elsewhere made the model worse than plain B.

Quick start

Download one file (the recommended mix):

huggingface-cli download Rami8612/Qwen3.8-27B-Solidity-v1-GGUF Qwen3.8-27B-Solidity-v1-Q4_K_Mix-imat.gguf --local-dir .

Run with llama.cpp (recent build, with support for the Qwen3.8 hybrid architecture):

llama-server -m Qwen3.8-27B-Solidity-v1-Q4_K_Mix-imat.gguf -ngl 99 -fa on -c 65536 --jinja --reasoning off

The server is OpenAI-compatible at http://localhost:8080/v1. The GGUF files also load in LM Studio and other llama.cpp-based apps.

Which file should I choose?

FileSizeFits onContext (approx., q8_0 KV cache)Notes
Qwen3.8-27B-Solidity-v1-Q4_K_Mix-imat.gguf18.7 GB24–32 GB GPUs128k on 32 GB (measured: 22.5 GB used)Recommended: best fidelity at Q4-like size
Qwen3.8-27B-Solidity-v1-Q4_K_M-imat.gguf16.8 GB20–24 GB GPUsMost context per GBSmallest; standard Q4_K_M with imatrix
Qwen3.8-27B-Solidity-v1-Q5_K_M-imat.gguf19.5 GB24–32 GB GPUsSlightly less than IHighest fidelity of the three

Only the I figure was measured. The other values are estimates.

Prompt format and settings

  • Chat template: Qwen ChatML, embedded in the GGUF (use --jinja).
  • Thinking: off (--reasoning off, or "chat_template_kwargs": {"enable_thinking": false}). In our tests the fine-tune works best without thinking.
  • Temperature: 0 for repeatable output. 0.7–0.8 explores more varied answers, so running a few samples can surface issues a single greedy pass misses.
  • Speculative decoding: no MTP / speculative decoding (see below).
  • System prompt used in training and evaluation:
You are an expert smart contract security auditor performing an authorized security review. Review the Solidity code you are given and report every High or Medium severity vulnerability you find. For each finding give a title, severity, location (contract/function), the root cause, how an attacker would exploit it step by step (attack path), the impact, and a recommended fix. If there are no High or Medium issues, state that clearly.
  • User message format used in training:
Audit the following Solidity file from the project `<project>`.

File: `<path>`

```solidity
<code>
```

Running it on a V100 32 GB

  • Software: CUDA 12 (CUDA 13 dropped Volta) and llama.cpp built with -DCMAKE_CUDA_ARCHITECTURES=70.
  • Fit: Q4_K_Mix-imat with 128k context and a q8_0 KV cache uses about 22.5 GB.
  • Speed: prompt processing ~500–760 tok/s, generation ~30 tok/s.
llama-server -m Qwen3.8-27B-Solidity-v1-Q4_K_Mix-imat.gguf -ngl 99 -fa on -c 131072 -ctk q8_0 -ctv q8_0 \
  --jinja --reasoning off
  • MTP speculative decoding (--spec-type draft-mtp) doubles the speed (65 tok/s) but degrades this fine-tune's output: repeated findings, or loops with an f16 cache. The MTP head (blk.64.nextn) is the untouched base-model head. Do not use it with this model.
  • Thinking off is recommended.

Limitations

This is a v1 experiment. Tests on real-world contracts beyond the benchmark showed clear weaknesses:

  • Findings on clean code: it reports findings on most clean files (86–97%), because only 17% of the training data were negatives.
  • Hallucinations: it sometimes invents code, such as treating SafeERC20 library helpers like safeTransfer as token functions, and it can repeat the same finding.
  • Complex bugs: it catches direct missing-check bugs well. Complex cross-function bugs (e.g. re-entrancy through an inherited entry point) appear only occasionally, and only with sampling (temperature ~0.8).
  • Metrics: the metrics are automatic approximations.

Files

FileSizeNotes
Qwen3.8-27B-Solidity-v1-Q4_K_Mix-imat.gguf18.7 GBRecommended. Custom per-tensor mix (variant I of the study): best fidelity at ~Q4 size
Qwen3.8-27B-Solidity-v1-Q4_K_M-imat.gguf16.8 GBStandard Q4_K_M with imatrix: smallest, longest context
Qwen3.8-27B-Solidity-v1-Q5_K_M-imat.gguf19.5 GBStandard Q5_K_M with imatrix: higher fidelity
Qwen3.8-27B-Solidity-v1-BF16-00001-of-00002.gguf + -00002-of-00002.gguf54.7 GBFull-precision BF16 weights, split in two (Hugging Face 50 GB file limit). llama.cpp loads them when pointed at the first part. Use them with the imatrix to make any other quant
Qwen3.8-27B-Solidity-v1-imatrix.gguf13.6 MBImportance matrix (6-domain calibration)
lora/340 MBLoRA adapter for unsloth/Qwen3.8-27B (PEFT/Transformers), with tokenizer and chat template

Make your own quant, e.g. Q6_K:

llama-quantize --imatrix Qwen3.8-27B-Solidity-v1-imatrix.gguf Qwen3.8-27B-Solidity-v1-BF16-00001-of-00002.gguf Qwen3.8-27B-Solidity-v1-Q6_K-imat.gguf Q6_K

Compute

Training1× H100 NVL 94 GB, 3 h 55 min
Whole project on H100 (tests, training, evaluation, quantization)≈ 13 GPU-hours
Real-hardware testing1× V100 SXM2 32 GB, a few hours
Cloud providersVast.ai (H100), SimplePod (V100)

Changelog

  • v1 (2026-10-03): first release.
    • LoRA SFT on Solidity audit data;
    • custom imatrix GGUF mixes;
    • evaluation against the base model and DeepSeek V4 Pro.

Citation

@misc{rami8612_qwen38_solidity_sft_v1,
  title  = {Qwen3.8-27B-Solidity-v1: fine-tuning and quantization study},
  author = {Rami8612},
  year   = {2026},
  url    = {https://huggingface.co/Rami8612/Qwen3.8-27B-Solidity-v1-GGUF}
}

Credits and license

  • Base model: unsloth/Qwen3.8-27B, Unsloth's release of Qwen3.8-27B by the Qwen team (Apache-2.0).
  • Reasoning traces: generated with DeepSeek V4 Pro (MIT).
  • Training data: derived from publicly available smart-contract audit reports, exploit analyses and contract source code.
  • Tools: training with Unsloth and TRL; quantization and serving with llama.cpp.

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

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

GPU в ailist

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

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
4900ca3

0 моделей