/ Модель

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

Контекст
8 192 токена
Параметры
66 млн
Лицензия
MIT
Архитектура
captionbert_structured_rotary · dense
Базовая модель
bert-base-uncased
Библиотека
transformers
Опубликована
6 ноя 2026

captionbert-8192-rotary

ЭмбеддингиТекст → embedding8 профессий

Англоязычный энкодер CaptionBERT извлекает 768-мерные векторы предложений для сравнения семантической близости подписей и текстов.

138скачиваний за 30 дней1лайквеса обновлены6 ноя 2026

Бенчмарки

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

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

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

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

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

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

CaptionBERT 8192 rotary — англоязычный энкодер предложений, разработанный AbstractPhil. Модель предназначена для получения векторных представлений подписей и сравнения их семантической близости. Она дообучена на основе консенсуса пяти BERT-семейств и выдаёт нормализованный вектор размерности 768; для извлечения признаков используются модель и её токенизатор, без необходимости загружать модели-учителя.

Архитектура включает 12 слоёв, скрытую размерность 512, 16 голов внимания и FFN размером 2048. Вариант по умолчанию использует относительное NTK-масштабированное RoPE с коэффициентом 4. Контекстная ёмкость исполнения проверена до 8192 токенов, однако модель обучалась с пределом входа 256 токенов, а качество на текстах длиной 8K не оценивалось. В бенчмарках семантического сходства результаты зависят от набора и seed; опубликованные значения не гарантируют качество на иных данных.

Модель сохранена в формате safetensors и совместима с Transformers. Лицензия — MIT.

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

  • получение эмбеддингов англоязычных предложений
  • поиск семантически похожих подписей
  • ранжирование пар текстов по смысловой близости
  • кластеризация коротких англоязычных текстов

Ограничения

Качество на последовательностях длиной 8K токенов не измерялось; обучение проводилось с пределом входа 256 токенов. Результаты тестов семантического сходства различаются между наборами и seed, поэтому они не гарантируют качество на других данных.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

CaptionBERT 8192 rotary

A 54.1M-parameter standalone caption sentence encoder distilled from the published consensus of five BERT-family teachers. Inference uses this model and its tokenizer, with 768-dimensional normalized sentence output.

The default is Relative 16 heads (N16), seed 1, trained on 4,000,000 paired caption rows for 7,808 steps. It is the development-selected release from the completed structured-rotary campaign. The two 4M architecture means are a near tie; the default follows the declared preference for fewer additions. Both seed pairs and every other trained option remain available.

12 layers · hidden width 512 · 16 heads · FFN2048 · trained input ceiling 256. 8192 is the checked execution capacity; 8K semantic quality was not measured.

Plain-English report · Technical companion · Training repository · CPU TensorBoard viewer

Load the model

import torch
from transformers import AutoModel, AutoTokenizer

repo = "AbstractPhil/captionbert-8192-rotary"
revision = "ad14b77f4cc9017d513173f3b340e735af02ef14"
tokenizer = AutoTokenizer.from_pretrained(repo, revision=revision)
model = AutoModel.from_pretrained(
    repo, revision=revision, trust_remote_code=True, use_safetensors=True
).eval()

batch = tokenizer(
    ["A cat watches from a windowsill.", "A feline looks out the window."],
    padding=True, truncation=True, max_length=256, return_tensors="pt"
)
with torch.inference_mode():
    output = model(**batch)

embeddings = output.pooler_output       # [2, 768], L2-normalized
tokens = output.last_hidden_state      # [2, sequence_length, 512]
similarity = (embeddings[0] @ embeddings[1]).item()

The saved tokenizer uses right padding, matching training. No teacher models or training package are required. Pin the tested revision in the serving verification report when reproducing exact results.

Weights are model.safetensors, saved with safe_serialization=True and PyTorch header metadata format: pt. Self-contained configuration/model source and AutoConfig/AutoModel mappings accompany them.

Final sentence benchmarks

The default architecture and seed were selected using STS-B validation, before reading these test outcomes. All six larger models are shown. Spearman correlation, 64-token ceiling, same eight pinned task test splits; the mean weights tasks equally.

Recipe / optionSeedSTS-BSICK-RSTS12STS13STS14STS15STS16BIOSSESMean
4M ×4 epochs / Hierarchical10.54270.65360.48820.55230.52750.70230.62260.47530.5706
4M ×4 epochs / Hierarchical20.55400.65350.49320.55890.52850.69810.62430.51970.5788
4M ×4 epochs / Relative 16 heads10.53850.64510.48230.54660.53000.69970.62320.51690.5728
4M ×4 epochs / Relative 16 heads20.54480.64920.48840.55000.53160.70020.62490.47910.5710
1M ×16 epochs / Hierarchical10.54510.65530.48370.52600.51730.69500.61070.46570.5623
1M ×16 epochs / Hierarchical20.54100.65700.49130.53580.52440.70050.60460.49750.5690

Pair test means are hierarchical 4M 0.57467, relative 4M 0.57191, and hierarchical matched exposure 0.56567. Hierarchical-minus-relative directions differ between seeds. The strongest individual test row is hierarchical seed 2; it does not replace the development-selected default.

The release is one checkpoint, with both seeds retained for comparison. Training gradients use caption/consensus targets; STS-B validation labels influence architecture and seed selection. The historical CaptionBERT v2 numbers are a separate experiment and are not treated as a matched rotary comparison here.

Development and geometry

RecipeOptionSeedDev STS-BDev teacher cosineDev participation rank
4M ×4 epochsHierarchical10.682950.8101796.60
4M ×4 epochsHierarchical20.688540.8106696.51
4M ×4 epochsRelative 16 heads10.686720.8176997.20
4M ×4 epochsRelative 16 heads20.686330.8181197.13
1M ×16 epochsHierarchical10.683310.8080195.63
1M ×16 epochsHierarchical20.677750.8087995.51
Recipe / optionSeedChunk060 samplenTeacher cosineParticipation rankSelf cosine
4M ×4 epochs / Hierarchical1All sampled rows50000.80975895.9520.003311
4M ×4 epochs / Hierarchical1>128-token rows50000.73577275.2110.008305
4M ×4 epochs / Hierarchical2All sampled rows50000.81009895.8540.003095
4M ×4 epochs / Hierarchical2>128-token rows50000.73514575.1730.008127
4M ×4 epochs / Relative 16 heads1All sampled rows50000.81797596.3370.003996
4M ×4 epochs / Relative 16 heads1>128-token rows50000.74008976.0730.010202
4M ×4 epochs / Relative 16 heads2All sampled rows50000.81817996.2430.003710
4M ×4 epochs / Relative 16 heads2>128-token rows50000.74001476.0530.009820
1M ×16 epochs / Hierarchical1All sampled rows50000.80766394.9740.003575
1M ×16 epochs / Hierarchical1>128-token rows50000.73725473.6770.011612
1M ×16 epochs / Hierarchical2All sampled rows50000.80812394.8680.003176
1M ×16 epochs / Hierarchical2>128-token rows50000.73798773.5110.010763

Caption geometry uses deterministic 5,000-row samples from the separate chunk 060, plus a separate 5,000-row >128-token sample. Participation rank uses centered covariance in FP64; self cosine is the exact off-diagonal mean. Teacher cosine measures consensus reproduction, separately from capability.

What the structured experiment found

The screen trained eight options under both weight seeds and repeated its sixteen-head relative reference, for 18 screen models. The larger stage adds the two4M architecture pairs and a1M matched-exposure hierarchical pair, for 24 trained models in this campaign.

The complete whole-key model's designated lookup head found the correct earlier record on all 10,146 sampled query positions under both seeds. Mean correct-record probability was0.999510/0.999516, across1,935 target-bearing captions from 4,096 development rows. Its sentence-development result did not establish a benefit from that accurate read. The full report separates word-record attention, teacher reproduction, pooled sentence similarity and serving parity.

The adaptation uses a three-digit base-eight segment address, a zero-born value path and, in complete binding options, whole-WordPiece key phases, record-only norm 2.18 and lookup supervision. The default's actual rotary mode is NTK-scaled relative RoPE; 16 heads, scale 4; no hierarchical value path or lexical binding. Complete binding models and controls remain under their explicit experiment paths; they are not silently replaced by the default.

Construction and continuation

  • Screen:1M paired rows,4 epochs,1,952steps,200-step warmup.
  • Larger4M: chunks000,001,002,003,004,006,009,010,4 epochs.
  • Exposure control: original1M rows,16 epochs.
  • Every larger recipe:7,808steps, batch 2,048,15,990,784 example presentations, 400-step warmup, peak LR6e-4 and cosine decay to1e-6.
  • Pure Adam, weight decay0, clipping1.0, symmetric InfoNCE at 0.07 plus MSE. Lookup loss weight0.1 only in its declared screen options.
  • FP32 parameters/optimizer, BF16 training autocast, TF32 off.
  • Caption/target pairing is exact flat row index. Chunk061 is development, chunk 060 caption test. No image-ID join, refit alignment or fallback teacher.

The artifact census pins every run, final/best/midpoint weights, independent optimizer/RNG state, logs, raw queries, data manifests and TensorBoard events. Original experiments retain their paths. Recovery notebooks verify compatible identities, resume partial state and skip only verified completed models.

Numerical and shape verification

The selected default was tested from both its local export directory and the actual Hub repository at immutable revision ad14b77f4cc9017d513173f3b340e735af02ef14. Separate local and G4 processes compared it with the independently restored final training state and exact training implementation. Each default check contains twelve precision/shape cases plus two padding comparisons. Every tested native/AutoModel sentence and token output had maximum absolute difference zero. The G4 default check used Transformers 5.22.1, PyTorch 2.15.0+cu132 and Safetensors 0.8.0; the separate binding G4 check used Transformers 5.22.2. The local default checks stayed below 4.2 decimal GB total device use under an 18 GB guard. These are same-device, same-precision comparisons within each environment, not a claim that outputs are bitwise identical between different GPUs.

Measured reports: local export, Hub load on the local GPU, Hub load on G4, and the executed model-card example.

Checks compare an independently loaded final training state with the separate safe AutoModel export, including every state tensor and actual outputs. They exercise multiple batch/length shapes, all-padding, right padding, optional attention/pointer diagnostics and FP16/BF16 autocast with FP32 weights.

Model / loadTransformersPyTorchCase entriesMax sentence / token deltaPeak observed device GB
Complete binding / localnot captured2.11.0+cu128120 / 03.652
Complete binding / Colab5.22.22.15.0+cu132140 / 01.635
Default / local directory4.57.62.11.0+cu128140 / 04.120
Default / Hub on local GPU4.57.62.11.0+cu128140 / 04.384
Default / Hub on Colab5.22.12.15.0+cu132140 / 01.633

Outputs through 8,192 tokens are engineering shape/finite-value checks. Long-context semantic quality,512-address retrieval in this encoder and cross-hardware bitwise equality are not established by those checks. Per-case timings are diagnostic wall times, not a throughput study.

Limits

Training and caption evaluation use at most256 tokens; the sentence suite uses 64. The data consists of caption rows with an English uncased WordPiece tokenizer; image-level and near-duplicate independence across every chunk was not established. Two weight seeds and the screen reference repeat do not provide a full-stage population significance test.

Whole-word identity is exact after tokenization, including its uncasing. The encoder is bidirectional and receives the complete input. A word-record read here does not establish causal external-memory writing, coreference resolution, or general binding-sensitive sentence quality. Frozen binding-path removal also bypasses its norm operation; it does not isolate phase necessity for every trainable head. The missing pointer-only trained control is a proposed next stage.

Use right padding for binding variants: shifting lexical word phases relative to positional special-token phases can change their native output under left padding. The serving verifier measures native/AutoModel agreement under both.

Output convention

FieldShapeMeaning
last_hidden_state[B,L,512]Token states
pooler_output[B,768]L2-normalized sentence vector
hidden_states, when requested13 tensorsInput plus 12 layers
attentions, when requested12 tensors[B,16,L,L] per layer
pointer_loss, when requestedscalarAuxiliary diagnostic loss

All-padding sentence vectors are zero. Token states are not promised to be zero at padding positions. This API does not define an encode method or embedding alias; use pooler_output for sentence similarity.

Citation

@misc{abstractphil2026captionbertrotary,
  title = {Structured rotary CaptionBERT: precise word reads and the sentence-embedding test},
  author = {AbstractPhil},
  year = {2026},
  url = {https://huggingface.co/AbstractPhil/captionbert-8192-rotary}
}

MIT. Format follows the CaptionBERT v2 card.

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

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

0 моделей