/ Модель

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

Контекст
4 096 токенов
Размер весов
16,9 ГБ
Архитектура
detikzify · dense
Базовая модель
detikzify-v2-8b
Библиотека
transformers
Опубликована
27 июн 2025

detikzify-v2.5-8b

Генерация текстаТекст → текст3 профессии

DeTi*k*Zifyv2.5 — мультимодальная модель, превращающая наброски и научные иллюстрации в редактируемый код Ti*k*Z.

334скачиваний за 30 дней11лайковвеса обновлены1 июл 2025

Бенчмарки

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

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

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

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

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

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

DeTi*k*Zifyv2.5 (8b) — мультимодальная языковая модель, разработанная командой DeTi*k*Zify. Она преобразует наброски и научные иллюстрации в редактируемые программы на Ti*k*Z с сохранением визуального смысла. Модель основана на DeTi*k*Zifyv2-8b и дополнительно обучена методом обучения с подкреплением на основе собственной обратной связи (RLSF), используя самостоятельно вычисляемые награды без внешней модели вознаграждения.

Модель предназначена для преобразования изображений схем, графиков и других научных рисунков в код Ti*k*Z; также она работает с текстовыми входами через Ti*k*Zero adapters. При выводе может итеративно уточнять результат с помощью поиска по дереву Монте-Карло (MCTS), оценивая визуальное сходство с исходным рисунком. Модель относится к семейству DeTikzify, имеет плотную архитектуру и доступна в формате safetensors для Transformers. В метаданных указана задача text-generation; README отдельно подтверждает обработку изображений и набросков. Лицензия в предоставленных данных не указана.

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

  • преобразование наброска схемы в код Ti*k*Z
  • создание редактируемого графика по изображению
  • перевод научной иллюстрации в программу Ti*k*Z
  • восстановление кода визуально похожего рисунка
  • генерация Ti*k*Z по текстовому запросу через Ti*k*Zero adapters

Ограничения

Качество зависит от сложности и визуальной структуры исходного рисунка; результаты требуют проверки и могут нуждаться в ручном редактировании. Данные не сообщают о лицензии модели.

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

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

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

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

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

Открыть на Hugging Face

Model Card for DeTikZifyv2.5 (8b)

DeTikZifyv2.5 (8b) is a multimodal language model that automatically converts sketches and existing scientific figures into editable, semantics-preserving TikZ graphics programs. It builds on DeTikZifyv2 post-trained with reinforcement learning and self-computed rewards. This approach, which we call reinforcement learning from self-feedback (RLSF), allows the model to considerably improve itself without necessitating external reward functions. Check out the DeTikZify project for more information and tips on how to best run the model.

Usage

from operator import itemgetter

from detikzify.model import load
from detikzify.infer import DetikzifyPipeline

image = "https://w.wiki/A7Cc"
pipeline = DetikzifyPipeline(*load(
    model_name_or_path="nllg/detikzify-v2.5-8b",
    device_map="auto",
    torch_dtype="bfloat16",
))

# generate a single TikZ program
fig = pipeline.sample(image=image)

# if it compiles, rasterize it and show it
if fig.is_rasterizable:
    fig.rasterize().show()

# run MCTS for 10 minutes and generate multiple TikZ programs
figs = set()
for score, fig in pipeline.simulate(image=image, timeout=600):
    figs.add((score, fig))

# save the best TikZ program
best = sorted(figs, key=itemgetter(0))[-1][1]
best.save("fig.tex")

Reinforcement Learning from Self-Feedback

Background

DeTikZify employs an iterative inference algorithm based on Monte Carlo Tree Search (MCTS), enabling it to continuously refine its outputs without additional training. The reward scores required by MCTS are computed entirely using DeTikZify's vision encoder, by visually assessing the similarity between input figures and compiled generated outputs. External reward models are not only unnecessary but often have lower correlations with human judgments, as the vision encoder was fine-tuned end-to-end with the entire model, optimizing it for evaluating this specific task. We refer readers to the DeTikZify and TikZero papers for further details.

These self-computed rewards have been effective in enhancing model outputs during inference. With reinforcement learning algorithms like Group Relative Policy Optimization, this reward signal could also be used for the model to improve itself during a post-training step, i.e., reinforcement learning from self-feedback (RLSF).

Model Training

Our post-training setup does only require figures, and does not require aligned code as in supervised fine-tuning, granting us more flexibility in selecting training data. 50% of the training data comes from the subset of DaTikZv3, that was filtered out during the training of DeTikZifyv2. The remaining 50% is sampled from the SPIQA dataset, which contains image labels for figures extracted from arXiv. We exclude all figures from papers included in DaTikZv3. We sample this split so that 60% of these figures are labeled as schematics, 20% as plots, and 20% come from other categories. Since these figures are not necessarily created from TikZ, they may aid in enhancing the model's generalization capabilities. As with DeTikZifyv2, input figures are randomly converted into synthetic sketches using image transformations and UltraSketch.

Using this dataset, we post-train DeTikZifyv2 with RLSF, employing a batch size of 16. For each image, 32 outputs are generated, resulting in the model being trained on 512 outputs per step. We train for a total of 500 steps which takes 5 days to complete on eight Nvidia H200 GPUs. We keep the vision encoder frozen to mitigate reward hacking.

Experiments and Results

We evaluate DeTikZifyv2.5 (8b) on the test split of DaTikZv3 and compare it to DeTikZifyv2 (8b). The metrics employed include DreamSim (DSim), Kernel Inception Distance (KID), CrystalBLEU (cBLEU), TeX Edit Distance (TED), Mean Token Efficiency (MTE), and Mean Sampling Throughput (MST). Refer to the DeTikZify paper for further details. All scores except MST are multiplied by 100.

Sampling-based Inference

In sampling-based inference (i.e., accepting the first output that compiles successfully) using reference figures and synthetic sketch inputs, DeTikZifyv2.5 (8b) outperforms DeTikZifyv2 (8b) on most metrics, demonstrating that RLSF can effectively enhance performance. The considerably increased DreamSim scores indicate that DeTikZifyv2.5 (8b) generates outputs that are much more visually similar to the reference figures. Furthermore, it is much less likely to produce outputs that do not compile, as evidenced by its perfect MTE score. Interestingly, while it scores lower on the code-based metric CrystalBLEU, it performs better on the code-based TED. DeTikZifyv2.5 (8b) tends to generate more concise programs with less syntactic noise. While this likely reduces the n-gram overlap with the reference code, it also decreases the number of edits necessary to convert one into another, explaining this phenomenon. Generally, more concise programs are beneficial as long as the semantics are preserved.

MCTS-based Inference

We observe similar trends when using our MCTS-based inference algorithm with a time budget of 10 minutes. Compared to sampling-based inference, DeTikZifyv2.5 (8b) noticeably improves its scores, illustrating that MCTS on top of RLSF can still lead to additional gains. Additionally, within the same timeframe, DeTikZifyv2.5 (8b) generates 25 more outputs than DeTikZifyv2 (8b), supporting our hypothesis that the generated programs are more concise. On reference figures, DeTikZifyv2.5 (8b) scores better on both DreamSim and KID, with the KID score even being slightly negative due to the high similarity of distributions. For synthetic sketches, it achieves a higher DreamSim score but performs worse on KID, indicating a prioritization of faithfulness to the reference figure over just focusing on general aesthetics.

Inference with TikZero Adapters

TikZero adapters integrate into the vision encoder of DeTikZify models, enabling them to be conditioned on text in addition to images. Since we keep the vision encoder frozen, we can evaluate DeTikZifyv2.5 (8b) on adapters trained for DeTikZifyv2 (8b). Compared to our previous experiments, the results are more varied. While DeTikZifyv2.5 (8b) achieves a better DreamSim value and maintains a perfect MTE, it performs worse on CLIPScore, suggesting difficulties in reproducing text from captions. This could be due to an increased modality gap, as RLSF further refines the model for image-only inputs. We plan to address this in future work by incorporating caption inputs into RLSF training.

Summary

Overall, RLSF greatly enhances model performance for most tasks. For image and sketch inputs, DeTikZifyv2.5 (8b) emerges as the clear leader. For text inputs via TikZero adapters, the choice between model versions depends on the specific use case, given the trade-offs involved.

Acknowledgments

This model was trained using computational resources provided by the bwForCluster Helix, as part of the bwHPC-S5 project. The authors acknowledge support from the state of Baden-Württemberg through the bwHPC initiative and the German Research Foundation (DFG) under grant INST 35/1597-1 FUGG. This project was inspired by the paper Rendering-Aware Reinforcement Learning for Vector Graphics Generation.

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

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

GPU в ailist

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

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

Архитектура detikzify неизвестна transformers в образе рантайма.

Класс архитектуры
DetikzifyForConditionalGeneration
Ревизия весов
f17cd78

0 моделей