Predictive metacognition: a neuro-computational framework for self-monitoring in large language models.
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: 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.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
- [2] 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
- [3] doi:10.1038/s41467-026-75841-9 [code]
- Model-based semantic distance reveals adaptive coordination of distinct cognitive systems in flexible knowledge retrieval.Journal: Nature communicationsIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive
- [4] doi:10.1038/s42003-026-10011-7 [code]
- Learning brain dynamics across distinct scaling regimes reveals psychiatric signatures.Journal: Communications biologyIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive
- [5] doi:10.1038/s42003-026-10169-0 [code]
- Shared representations in brains and models reveal a two-route cortical organization during scene perception.Journal: Communications biologyIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive
- [6] doi:10.7554/elife.107933 [code]
- Modality-agnostic decoding of vision and language from fMRI.Journal: eLifeIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive
- [7] doi:10.7554/elife.106543 [code]
- Stimulus dependencies-rather than next-word prediction-can explain pre-onset brain encoding in naturalistic listening designs.Journal: eLifeIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive
- [8] doi:10.1038/s41467-026-71267-5 [code]
- Human-like cognitive generalization for large models via mental representation-guided supervision.Journal: Nature communicationsIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive
- [9] doi:10.1038/s41598-026-41532-0 [code]
- Prediction, syntax and semantic grounding in the brain and large language models.Journal: Scientific reportsIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive
- [10] doi:10.1016/j.scog.2026.100443 [code]
- From thought to language: Comparing schizophrenia spectrum disorders and Wernicke's aphasia with machine learning and LLMs.Journal: Schizophrenia research. CognitionIn common: Hugging Face Transformers, PyTorch, pandas, 1 other tool, cognitive
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 its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
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: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
