Model reference · open weights

specter2_aug2023refresh

Available as managed deployment Embeddings allenai Embeddings 1 variants 2k dl/mo

specter2_aug2023refresh is an open-weight embedding model from allenai. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.

Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.

What it is

Released byallenai
TypeEmbedding models
TaskEmbeddings
Context512 tokens
Runs withtransformers
Released2023-08-14
Popularity2k downloads / month
LicenceOpen weights

About

What specter2_aug2023refresh is

SPECTER2

SPECTER2 is a family of models that succeeds SPECTER and is capable of generating task specific embeddings for scientific tasks when paired with adapters. This is the base encoder to be used with relevant task specific adapters. Given the combination of title and abstract of a scientific paper or a short texual query, the model can be used to generate effective embeddings to be used in downstream applications.

Note:For general embedding purposes, please use allenai/specter2.

Read the full model card

To get the best performance on a downstream task type please load the associated adapter () with the base model as in the example below.

Dec 2023 Update:

Model usage updated to be compatible with latest versions of transformers and adapters (newly released update to adapter-transformers) libraries.

******Update******

This update introduces a new set of SPECTER2 models with the base transformer encoder pre-trained on an extended citation dataset containing more recent papers. For benchmarking purposes please use the existing SPECTER2 models w/o the aug2023refresh suffix.

Note:For general embedding purposes, please use allenai/specter2.

To get the best performance on a downstream task type please load the associated adapter with the base model as in the example below.

Model Details

Model Description

SPECTER2 has been trained on over 6M triplets of scientific paper citations, which are available here. Post that it is trained with additionally attached task format specific adapter modules on all the SciRepEval training tasks.

Task Formats trained on:

  • Classification
  • Regression
  • Proximity
  • Adhoc Search

It builds on the work done in SciRepEval: A Multi-Format Benchmark for Scientific Document Representations and we evaluate the trained model on this benchmark as well.

  • Developed by: Amanpreet Singh, Mike D'Arcy, Arman Cohan, Doug Downey, Sergey Feldman
  • Shared by : Allen AI
  • Model type: bert-base-uncased + adapters
  • License: Apache 2.0
  • Finetuned from model: allenai/scibert.

Model Sources

Uses

Direct Use

ModelName and HF linkDescription
Proximity*allenai/specter2_aug2023refreshEncode papers as queries and candidates eg. Link Prediction, Nearest Neighbor Search
Adhoc Queryallenai/specter2_aug2023refresh_adhoc_queryEncode short raw text queries for search tasks. (Candidate papers can be encoded with the proximity adapter)
Classificationallenai/specter2_aug2023refresh_classificationEncode papers to feed into linear classifiers as features
Regressionallenai/specter2_aug2023refresh_regressionEncode papers to feed into linear regressors as features

*Proximity model should suffice for downstream task types not mentioned above

from transformers import AutoTokenizer
from adapters import AutoAdapterModel

# load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained('allenai/specter2_aug2023refresh_base')

#load base model
model = AutoAdapterModel.from_pretrained('allenai/specter2_aug2023refresh_base')

#load the adapter(s) as per the required task, provide an identifier for the adapter in load_as argument and activate it
model.load_adapter("allenai/specter2_aug2023refresh", source="hf", load_as="proximity", set_active=True)
#other possibilities: allenai/specter2_aug2023refresh_

papers = [{'title': 'BERT', 'abstract': 'We introduce a new language representation model called BERT'},
          {'title': 'Attention is all you need', 'abstract': ' The dominant sequence transduction models are based on complex recurrent or convolutional neural networks'}]

# concatenate title and abstract
text_batch = [d['title'] + tokenizer.sep_token + (d.get('abstract') or '') for d in papers]
# preprocess the input
inputs = self.tokenizer(text_batch, padding=True, truncation=True,
                                   return_tensors="pt", return_token_type_ids=False, max_length=512)
output = model(**inputs)
# take the first token in the batch as the embedding
embeddings = output.last_hidden_state[:, 0, :]

Downstream Use

For evaluation and downstream usage, please refer to https://github.com/allenai/scirepeval/blob/main/evaluation/INFERENCE.md.

Training Details

Training Data

The base model is trained on citation links between papers and the adapters are trained on 8 large scale tasks across the four formats. All the data is a part of SciRepEval benchmark and is available here.

The citation link are triplets in the form

{"query": {"title": ..., "abstract": ...}, "pos": {"title": ..., "abstract": ...}, "neg": {"title": ..., "abstract": ...}}

consisting of a query paper, a positive citation and a negative which can be from the same/different field of study as the query or citation of a citation.

Training Pr

From the published model card. Full card on the HuggingFace links in the sidebar.

Using it via the API

Call it like any OpenAI endpoint

Once AxForge deploys specter2-aug2023refresh for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (specter2-aug2023refresh below is illustrative; you get the exact model name on deployment.)

$ curl -sS https://api.axforge.ai/v1/embeddings \
  -H "Authorization: Bearer $AXFORGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"specter2-aug2023refresh","input":"text to embed"}'

Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms