← Open Source
google-deepmind

long-form-factuality

Benchmarking long-form factuality in large language models. Original code for our paper "Long-form factuality in large language models".

AI EngineeringTest & guardPython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
695
Stars
86
Forks
+3
This week
2
Contributors
Created 2024-03-25 · Updated 2026-10-15 · #14886 today
Top developers
JerryWeiAIchengrunyang

google-deepmind/long-form-factuality is ranked 14,886 with 695 stars.

Same-category comparison

google-deepmind/long-form-factuality is ranked 14,886 among these 8 peers; cyanheads/obsidian-mcp-server is ranked 14,885.

Same-category comparison
NameRankMetrics
if-ai/ComfyUI-IF_AI_tools14,854
Language:
Python
Stars:
698
Forks:
55
Description:
ComfyUI-IF_AI_tools is a set of custom nodes for ComfyUI that allows you to generate prompts using a local Large Language Model (LLM) via Ollama. This tool enables you to enhance your image generation workflow by leveraging the power of language models.
itwanger/PaiAgent14,856
Language:
Java
Stars:
698
Forks:
138
algolia/algoliasearch-client-php14,874
Language:
PHP
Stars:
696
Forks:
112
Description:
⚡️ A fully-featured and blazing-fast PHP API client to interact with Algolia.
cyanheads/obsidian-mcp-server14,885
Language:
TypeScript
Stars:
695
Forks:
105
Description:
Read, write, search, and surgically edit Obsidian vault notes, tags, and frontmatter via MCP. STDIO or Streamable HTTP.
strands-agents/sdk-typescript14,892
Language:
TypeScript
Stars:
695
Forks:
103
Description:
A model-driven approach to building AI agents in just a few lines of code.
HKUDS/AnyTool14,894
Language:
Python
Stars:
694
Forks:
94
Description:
"AnyTool: Universal Tool-Use Layer for AI Agents".
Tanuki/tanuki.py14,896
Language:
Python
Stars:
694
Forks:
27
Description:
Prompt engineering for developers.
anthropics/cwc-long-running-agents14,897
Language:
Shell
Stars:
694
Forks:
77
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryAI Engineering
SubcategoryTest & guard
KeywordsFactuality
Stars695
Forks86
Contributors2
Created date2024-03-25
Updated date2026-10-15
Stars in 1 day0
Stars in 7 days3
Rank14,886
Previous rank6,606
Rank change-8,280
7-day stars rank7,290
Previous 7-day stars rank7,318
7-day stars rank change28
Total stars rank14,963
Previous total stars rank14,926
Total stars rank change-37
CountryUK
README summary

Long-Form Factuality in Large Language Models This is the official code release accompanying our paper "Long-form factuality in large language models". **LongFact**: A prompt set of 2,280 fact-seeking prompts requiring long-form responses. **Search-Augmented Factuality Evaluator (SAFE)**: Automatic evaluation of model responses in long-form factuality settings. **F1@K**: Extending F1 score to long-form settings using recall from human-preferred length. **Experimentation pipeline** for benchmarking OpenAI and Anthropic models using LongFact + SAFE. Installation First

, clone our GitHub repository. Then navigate to the newly-created folder. All external package requirements are listed in . To install all packages, and run the following command. Usage LongFact The full prompt set for LongFact is available in the folder. See the README in for more details about the dataset. To run the data-generation pipeline that we used to generate LongFact, use the following command. Refer to the README in for additional details about the data-generation pipeline. SAFE

Our full implementation of SAFE is located in . See the README in for more information about how SAFE works. To run the pipeline for evaluating SAFE against FActScore human annotations, use the following command. Refer to the README in for additional details about this experiment. Benchmarking models To benchmark OpenAI and Anthropic models, first add your API keys to (see README in for more information; be sure not to publish these keys). To obtain model responses for a given prompt

set, use the following command. Refer to the README in for additional details about our main experimentation pipeline. Next, to evaluate prompt-response pairs from our main experimentation pipeline using SAFE, use the following command, making sure to add the path to the file containing the prompt-response pairs to be evaluated to the argument. Unit Tests Each file in this directory has a corresponding unit test with the suffix (e. Run commands for individual tests are shown in the

unit test files. To run all unit tests, use the following command. Citing this work If you find our code useful, please cite our paper: License and disclaimer Copyright 2024 DeepMind Technologies Limited All software is licensed under the Apache License, Version 2. 0); you may not use this file except in compliance with the Apache 2. 0 license at: All other materials are licensed under the Creative Commons Attribution 4. You may obtain a copy of the CC-BY

license at: Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2. 0 or CC-BY licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.

Frequently asked questions

How many stars and forks are recorded?

google-deepmind/long-form-factuality has 695 stars and 86 forks.

What is the repository rank?

google-deepmind/long-form-factuality is ranked 14,886.

What language and category are recorded?

google-deepmind/long-form-factuality has 695 stars, uses Python and belongs to AI Engineering.

Which repository is closest in rank?

google-deepmind/long-form-factuality is compared with cyanheads/obsidian-mcp-server, ranked 14,885 with 695 stars.

README

Long-Form Factuality in Large Language Models

This is the official code release accompanying our paper "Long-form factuality in large language models". This repository contains:

  1. LongFact: A prompt set of 2,280 fact-seeking prompts requiring long-form responses.
  2. Search-Augmented Factuality Evaluator (SAFE): Automatic evaluation of model responses in long-form factuality settings.
  3. F1@K: Extending F1 score to long-form settings using recall from human-preferred length.
  4. Experimentation pipeline for benchmarking OpenAI and Anthropic models using LongFact + SAFE.

Installation

First, clone our GitHub repository.

git clone https://github.com/google-deepmind/long-form-factuality.git

Then navigate to the newly-created folder.

cd long-form-factuality

Next, create a new Python 3.10+ environment using conda.

conda create --name longfact python=3.10

Activate the newly-created environment.

conda activate longfact

All external package requirements are listed in requirements.txt. To install all packages, and run the following command.

pip install -r requirements.txt

Usage

LongFact

The full prompt set for LongFact is available in the longfact/ folder. See the README in longfact/ for more details about the dataset.

To run the data-generation pipeline that we used to generate LongFact, use the following command. Refer to the README in data_creation/ for additional details about the data-generation pipeline.

python -m data_creation.pipeline

SAFE

Our full implementation of SAFE is located in eval/safe/. See the README in eval/safe/ for more information about how SAFE works.

To run the pipeline for evaluating SAFE against FActScore human annotations, use the following command. Refer to the README in eval/ for additional details about this experiment.

python -m eval.correlation_vs_factscore

Benchmarking models

To benchmark OpenAI and Anthropic models, first add your API keys to common/shared_config.py (see README in common/ for more information; be sure not to publish these keys). To obtain model responses for a given prompt set, use the following command. Refer to the README in main/ for additional details about our main experimentation pipeline.

python -m main.pipeline

Next, to evaluate prompt-response pairs from our main experimentation pipeline using SAFE, use the following command, making sure to add the path to the .json file containing the prompt-response pairs to be evaluated to the --result_path argument.

python -m eval.run_eval \
    --result_path=

Unit Tests

Each file in this directory has a corresponding unit test with the _test suffix (e.g., file.py would have file_test.py for unit tests). Run commands for individual tests are shown in the unit test files. To run all unit tests, use the following command.

python -m unittest discover -s ./ -p "*_test.py"

Citing this work

If you find our code useful, please cite our paper:

@misc{wei2024long,
  title={Long-form factuality in large language models},
  author={Wei, Jerry and Yang, Chengrun and Song, Xinying and Lu, Yifeng and Hu, Nathan and Huang, Jie and Tran, Dustin and Peng, Daiyi and Liu, Ruibo and Huang, Da and Du, Cosmo and Le, Quoc V.},
  year={2024},
  url={https://arxiv.org/abs/2403.18802},
}

License and disclaimer

Copyright 2024 DeepMind Technologies Limited

All software is licensed under the Apache License, Version 2.0 (Apache 2.0); you may not use this file except in compliance with the Apache 2.0 license. You may obtain a copy of the Apache 2.0 license at: https://www.apache.org/licenses/LICENSE-2.0

All other materials are licensed under the Creative Commons Attribution 4.0 International License (CC-BY). You may obtain a copy of the CC-BY license at: https://creativecommons.org/licenses/by/4.0/legalcode

Unless required by applicable law or agreed to in writing, all software and materials distributed here under the Apache 2.0 or CC-BY licenses are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the licenses for the specific language governing permissions and limitations under those licenses.

This is not an official Google product.

Nearby in the ranking
Similar items