allenai / specter2_base

huggingface.co
Total runs: 1.1M
24-hour runs: 15.9K
7-day runs: 36.4K
30-day runs: 367.3K
Model's Last Updated: December 04 2024
feature-extraction

Introduction of specter2_base

Model Details of specter2_base

SPECTER2

SPECTER2 is the successor to SPECTER and is capable of generating task specific embeddings for scientific tasks when paired with adapters . This is the base model to be used along with the 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 .

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.

Aug 2023 Update:

  1. The SPECTER2 Base and proximity adapter models have been renamed in Hugging Face based upon usage patterns as follows:
Old Name New Name
allenai/specter2 allenai/specter2_base
allenai/specter2_proximity allenai/specter2
  1. We have a parallel version (termed aug2023refresh ) where the base transformer encoder version is pre-trained on a collection of newer papers (published after 2018). However, for benchmarking purposes, please continue using the current version.

An adapter for the allenai/specter2_base model that was trained on the allenai/scirepeval dataset.

This adapter was created for usage with the adapters library.

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 (Retrieval)
  • 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
Model Name and HF link Description
Proximity* allenai/specter2 Encode papers as queries and candidates eg. Link Prediction, Nearest Neighbor Search
Adhoc Query allenai/specter2_adhoc_query Encode short raw text queries for search tasks. (Candidate papers can be encoded with the proximity adapter)
Classification allenai/specter2_classification Encode papers to feed into linear classifiers as features
Regression allenai/specter2_regression Encode 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_base')

#load base model
model = AutoAdapterModel.from_pretrained('allenai/specter2_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", source="hf", load_as="proximity", set_active=True)
#other possibilities: allenai/specter2_<classification|regression|adhoc_query>

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 Procedure

Please refer to the SPECTER paper .

Training Hyperparameters

The model is trained in two stages using SciRepEval :

  • Base Model: First a base model is trained on the above citation triplets.

batch size = 1024, max input length = 512, learning rate = 2e-5, epochs = 2 warmup steps = 10% fp16

  • Adapters: Thereafter, task format specific adapters are trained on the SciRepEval training tasks, where 600K triplets are sampled from above and added to the training data as well.

batch size = 256, max input length = 512, learning rate = 1e-4, epochs = 6 warmup = 1000 steps fp16

Evaluation

We evaluate the model on SciRepEval , a large scale eval benchmark for scientific embedding tasks which which has [SciDocs] as a subset. We also evaluate and establish a new SoTA on MDCR , a large scale citation recommendation benchmark.

Model SciRepEval In-Train SciRepEval Out-of-Train SciRepEval Avg MDCR(MAP, Recall@5)
BM-25 n/a n/a n/a (33.7, 28.5)
SPECTER 54.7 57.4 68.0 (30.6, 25.5)
SciNCL 55.6 57.8 69.0 (32.6, 27.3)
SciRepEval-Adapters 61.9 59.0 70.9 (35.3, 29.6)
SPECTER2 Base 56.3 73.6 69.1 (38.0, 32.4)
SPECTER2-Adapters 62.3 59.2 71.2 (38.4, 33.0)

Please cite the following works if you end up using SPECTER2:

[SciRepEval paper](https://api.semanticscholar.org/CorpusID:254018137)
```bibtex
@inproceedings{Singh2022SciRepEvalAM,
  title={SciRepEval: A Multi-Format Benchmark for Scientific Document Representations},
  author={Amanpreet Singh and Mike D'Arcy and Arman Cohan and Doug Downey and Sergey Feldman},
  booktitle={Conference on Empirical Methods in Natural Language Processing},
  year={2022},
  url={https://api.semanticscholar.org/CorpusID:254018137}
}

Runs of allenai specter2_base on huggingface.co

1.1M
Total runs
15.9K
24-hour runs
24.9K
3-day runs
36.4K
7-day runs
367.3K
30-day runs

More Information About specter2_base huggingface.co Model

More specter2_base license Visit here:

https://choosealicense.com/licenses/apache-2.0

specter2_base huggingface.co

specter2_base huggingface.co is an AI model on huggingface.co that provides specter2_base's model effect (), which can be used instantly with this allenai specter2_base model. huggingface.co supports a free trial of the specter2_base model, and also provides paid use of the specter2_base. Support call specter2_base model through api, including Node.js, Python, http.

specter2_base huggingface.co Url

https://huggingface.co/allenai/specter2_base

allenai specter2_base online free

specter2_base huggingface.co is an online trial and call api platform, which integrates specter2_base's modeling effects, including api services, and provides a free online trial of specter2_base, you can try specter2_base online for free by clicking the link below.

allenai specter2_base online free url in huggingface.co:

https://huggingface.co/allenai/specter2_base

specter2_base install

specter2_base is an open source model from GitHub that offers a free installation service, and any user can find specter2_base on GitHub to install. At the same time, huggingface.co provides the effect of specter2_base install, users can directly use specter2_base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

specter2_base install url in huggingface.co:

https://huggingface.co/allenai/specter2_base

Url of specter2_base

specter2_base huggingface.co Url

Provider of specter2_base huggingface.co

allenai
ORGANIZATIONS

Other API from allenai

huggingface.co

Total runs: 216.4K
Run Growth: 89.3K
Growth Rate: 41.27%
Updated:July 28 2025
huggingface.co

Total runs: 136.2K
Run Growth: -2.6K
Growth Rate: -1.93%
Updated:January 23 2026
huggingface.co

Total runs: 100.0K
Run Growth: 37.8K
Growth Rate: 37.79%
Updated:January 23 2026
huggingface.co

Total runs: 79.9K
Run Growth: -74.7K
Growth Rate: -93.49%
Updated:January 23 2026
huggingface.co

Total runs: 38.2K
Run Growth: 10.4K
Growth Rate: 27.18%
Updated:August 15 2024
huggingface.co

Total runs: 25.1K
Run Growth: -3.1K
Growth Rate: -12.29%
Updated:January 25 2023
huggingface.co

Total runs: 19.8K
Run Growth: 15.8K
Growth Rate: 79.65%
Updated:May 23 2026
huggingface.co

Total runs: 16.8K
Run Growth: -3.9K
Growth Rate: -23.39%
Updated:October 18 2023
huggingface.co

Total runs: 7.2K
Run Growth: 1.3K
Growth Rate: 18.08%
Updated:April 11 2026
huggingface.co

Total runs: 5.4K
Run Growth: 973
Growth Rate: 18.12%
Updated:December 04 2024
huggingface.co

Total runs: 4.4K
Run Growth: -1.2K
Growth Rate: -27.97%
Updated:July 17 2024
huggingface.co

Total runs: 3.9K
Run Growth: -788
Growth Rate: -20.07%
Updated:March 19 2026
huggingface.co

Total runs: 3.9K
Run Growth: -341
Growth Rate: -8.79%
Updated:June 23 2026
huggingface.co

Total runs: 3.7K
Run Growth: -1.3K
Growth Rate: -36.05%
Updated:June 23 2026
huggingface.co

Total runs: 3.6K
Run Growth: -129
Growth Rate: -3.56%
Updated:October 10 2025
huggingface.co

Total runs: 3.3K
Run Growth: -998
Growth Rate: -30.33%
Updated:July 17 2024
huggingface.co

Total runs: 3.0K
Run Growth: 3.0K
Growth Rate: 100.00%
Updated:June 23 2026
huggingface.co

Total runs: 2.6K
Run Growth: -3.3K
Growth Rate: -127.96%
Updated:May 21 2026
huggingface.co

Total runs: 2.0K
Run Growth: -2.4K
Growth Rate: -119.11%
Updated:October 09 2025
huggingface.co

Total runs: 1.7K
Run Growth: -390
Growth Rate: -22.47%
Updated:April 11 2026