Predictive metacognition: a neuro-computational framework for self-monitoring in large language models.
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Jupyter notebook · 77 lines · 2.8 KB · Apache-2.0
- # %% [markdown]
- # ### Setup
- #
- # Check that the Colab instance is using GPU: `[Runtime] -> [Change runtime type] -> [Hardware accelerator] -> [GPU]`.
- #
- # For larger models (3B+ parameters), change `[Runtime shape] -> [High-RAM]` as well.
- # %% [markdown]
- # ### Install requirements
- # %%
- !git clone https://github.com/sylinrl/TruthfulQA.git
- # %%
- cd TruthfulQA
- # %%
- !pip install -r requirements.txt
- # %%
- !pip uninstall -y protobuf
- !pip install --no-binary protobuf protobuf
- # %%
- !pip install -e .
- # %% [markdown]
- # ### Run models and metrics
- # %% [markdown]
- # To cache models and store results on Google Drive, uncomment the cell below and pass the appropriate filepaths to `evaluate.py`.
- # %%
- # import os
- # from google.colab import drive
- # drive.mount('/content/drive/', force_remount=True)
- # %% [markdown]
- # For supported models, answers and scores can be generated by running `evaluate.py` with the appropriate flags.
- #
- # To test the performance of a new model, add its answers to the input file as an additional column. The column name can then be passed in the list of models to `evaluate.py`, which will compute the corresponding generative metrics.
- # %% [markdown]
- #
- # | Flag | Description
- # | ----------- | ----------------------------------------------------------------- |
- # | `--models` | List of models to run (see below) |
- # | `--metrics` | List of metrics to run. Valid: MC, bleu, rouge, bleurt |
- # | `--preset` | Prompt before each question. Valid: qa, null, chat, long, help, harm |
- # | `--device` | Device index if running on GPU (torch must be compiled with CUDA)|
- # | `--input_path` | Location of question file |
- # | `--output_path` | Location of results file |
- # | `--cache_dir` | Location of cached HuggingFace models |
- # | `--gptj_path` | Location of GPT-J checkpoint |
- # %% [markdown]
- # | Model class | Models
- # | ----------- | ----------------------------------------------------------------- |
- # | `GPT-3` | ada, babbage, curie, davinci |
- # | `GPT-Neo/J` | neo-small, neo-med, neo-large, gptj |
- # | `GPT-2` | gpt2, gpt2-xl |
- # | `UnifiedQA` | uqa-small, uqa-base, uqa-large, uqa-3b |
- # %%
- # example call to evaluate.py -- switch the input to TruthfulQA.csv for the full dataset
- !python -m truthfulqa.evaluate --models gpt2 neo-small uqa-small --metrics mc bleu bleurt --input_path TruthfulQA_demo.csv --output_path TruthfulQA_answers.csv --device 0
- # %% [markdown]
- # While the output file contains model answers and metrics for each question individually, `evaluate.py` also saves a high-level summary of average `[metric]` by `[model]`, shown below. (The results currently displayed are on the example dataset of 3 questions.)
- # %%
- # if this fails to run right away, just re-run this cell and the next
- import pandas as pd
- summary = pd.read_csv('summary.csv') # load the saved summary file from evaluate.py
- # %%
- print(summary.to_string(index=False))
TruthfulQA-demo.ipynb at commit d71c110, under Apache-2.0 · at the source
Overview
- School of Information Technology, Deakin University,221 Burwood Highway, Burwood, Melbourne, VIC 3125 Australia
- Institute of Knowledge Integration & Design, Dankook University,152, Jukjeon-ro, Suji-gu, Yongin, Gyeonggi-do 16890 Republic of Korea
Abstract
Large Language Models demonstrate remarkable capabilities but suffer from critical metacognitive deficits, manifesting as overconfidence and hallucination, which severely limit their deployment in high-stakes applications. We introduce Predictive Metacognition, a neurobiologically-inspir
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above.
sylinrl/TruthfulQA
d71c110897f5d31c5d7f309e7bc316c152f6f031, 15 January 2025Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
11 files
- TruthfulQA-demo.ipynb, Jupyter, 77 lines
- setup.py, Python, 7 lines
- truthfulqa/
__init__.py , Python, 1 line - truthfulqa/
configs.py , Python, 43 lines - truthfulqa/
evaluate.py , Python, 191 lines - truthfulqa/
metrics.py , Python, 332 lines - truthfulqa/
models.py , Python, 575 lines - truthfulqa/
presets.py , Python, 330 lines - truthfulqa/
utilities.py , Python, 145 lines - LICENSE, License, 201 lines
- README.md, Text, 157 lines
Code availability
The code for our training and evaluation scripts, along with the LORA adapter weights for our models, will be made available upon request to support reproducibility.
Reproduced under the paper's license (CC BY), from the paper cited above.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 9 scripts, each with its path and the digest of its content;
- no match between paragraphs and code yet;
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- huggingface.co/
datasets/ , at Hugging Face; found in “Data availability”allenai/ ai2_arc - huggingface.co/
datasets/ , at Hugging Face; found in “Data availability”cais/ mmlu - huggingface.co/
datasets/ , at Hugging Face; found in “Data availability”google-research-datasets / natural_questions - huggingface.co/
datasets/ , at Hugging Face; found in “Data availability”rowan/ hellaswag - huggingface.co/
datasets/ , at Hugging Face; found in “Data availability”tau/ commonsense_qa - huggingface.co/
datasets/ , at Hugging Face; found in “Data availability”truthful_qa
Data availability
This study utilised publicly available benchmark datasets. The datasets and their access links are as follows: TruthfulQA: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 2 authors, 10 keywords, 4 MeSH terms, 1 funder, 29 references.
Cite
This paper
Luo, W., & Jho, H. (2026). Predictive metacognition: a neuro-computational framework for self-monitoring in large language models. Scientific reports, 16(1), 23962. https://
BibTeX
@article{luo2026predicti
author = {Luo, Wei and Jho, Hunkoog},
title = {{Predictive metacognition: a neuro-computational framework for self-monitoring in large language models}},
journal = {Scientific reports},
year = {2026},
month = may,
volume = {16},
number = {1},
pages = {23962},
publisher = {Nature Publishing Group},
issn = {2045-2322},
doi = {10.1038/
url = {https://
pmid = {42191827},
pmcid = {PMC13434765}
}
RIS
TY - JOUR
AU - Luo, Wei
AU - Jho, Hunkoog
TI - Predictive metacognition: a neuro-computational framework for self-monitoring in large language models
T2 - Scientific reports
J2 - Sci Rep
PY - 2026
DA - 2026/
VL - 16
IS - 1
SP - 23962
SN - 2045-2322
PB - Nature Publishing Group
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Predictive metacognition: a neuro-computational framework for self-monitoring in large language models",
"container-title": "Scientific reports",
"author": [
{
"family": "Luo",
"given": "Wei"
},
{
"family": "Jho",
"given": "Hunkoog"
}
],
"container-title-short":
"volume": "16",
"issue": "1",
"page": "23962",
"DOI": "10.1038/
"PMID": "42191827",
"PMCID": "PMC13434765",
"ISSN": "2045-2322",
"publisher": "Nature Publishing Group",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
26
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1093/nsr/nwaf551 [code]
- Neuromorphic spike-based large language model.Journal: National science reviewIn common: huggingface.co/datasets/allenai/ai2_arc, huggingface.co/datasets/rowan/hellaswag
- [2] doi:10.1038/s41467-023-42589-5 [code]
- Neural and computational underpinnings of biased confidence in human reinforcement learning.Journal: Nature communicationsIn common: cognitive, 5 references
- [3] doi:10.1016/j.isci.2024.109844 [code]
- Reward-related regions play a role in natural story comprehension.Journal: iScienceIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, 2 references
- [4] doi:10.1038/s42003-025-07646-3 [code]
- Neural mechanisms of metacognitive improvement under speed pressure.Journal: Communications biologyIn common: pandas, NumPy, cognitive, 3 references
- [5] doi:10.1162/nol_a_00105 [code]
- Strong Prediction: Language Model Surprisal Explains Multiple N400 Effects.Journal: Neurobiology of language (Cambridge, Mass.)In common: Hugging Face Transformers, pandas, NumPy, cognitive, 2 references
- [6] doi:10.1038/s41467-026-74358-5 [code]
- Brain-inspired spatial intelligence for embodied agents.Journal: Nature communicationsIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive, 1 reference
- [7] doi:10.1371/journal.pbio.3003588 [code]
- Sensory sharpening and semantic prediction errors unify competing models of predictive processing in human speech comprehension.Journal: PLoS biologyIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive, 1 reference
- [8] doi:10.1038/s41539-024-00231-z
- Relation of life sciences students' metacognitive monitoring to neural activity during biology error detection.Journal: NPJ science of learningIn common: cognitive, 3 references
- [9] doi:10.1038/s41467-026-74357-6 [code]
- Hippocampo-neocortical interaction as compressive retrieval-augmented generation.Journal: Nature communicationsIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, 1 reference
- [10] doi:10.1038/s42003-025-09377-x [code]
- Hierarchical linguistic predictions and cross-level information updating during narrative comprehension.Journal: Communications biologyIn common: Hugging Face Transformers, PyTorch, NumPy, cognitive, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 9 scripts, and 0 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:56b3377d0a5cf0f0…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41598-026-54840-2)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41598-026-54840-2.svg
:target: https://openscicode.org/badge/doi/10.1038/s41598-026-54840-2
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41598-026-54840-2"><img src="https://openscicode.org/badge/doi/10.1038/s41598-026-54840-2.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
