SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.01933 · CVPR · 2024

PREGO: online mistake detection in PRocedural EGOcentric videos

Fabio Galasso, Luca Scofano, Edoardo De Matteis, Guido Maria D'amely Di Melendugno, Alessandro Flaborea, Antonino Furnari, Leonardo Plini, ♠ Giovanni, Maria Farinella

arXiv · PDF · Open in the Atlas

Code that ran

11 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 10 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2404.01933.json · badge: /api/ran/2404.01933.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
aleflabo/PREGO canonical (classifier label)
classifier basis: census
11 ran · 0 no recorded run
FunctionStatusWhere it lives
apply_rotary_emb Ran
ran; our contract draft was wrong, not the code
aleflabo/PREGO/step_anticipation/llama/model.py
code served (permissive licence) · get_code("21b59364b1cadbc8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 5, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Understanding the function:
# - apply_rotary_emb takes xq, xk, and freqs_cis tensors
# - xq and xk are reshaped to complex numbers: reshape(*shape[:-1], -1, 2)
# - freqs_cis is reshaped for broadcasting with xq_
# - reshape_for_broadcast expects freqs_cis.shape == (x.shape[1], x.shape[-1])
# - The result of view_as_complex on xq gives shape (*xq.shape[:-1], -1)
# - So freqs_cis needs shape (seq_len, dim_complex) where dim_complex = original_dim // 2

# Let's construct tensors:
# - batch_size = 2
# - seq_len = 3
# - head_dim = 4 (will be reshaped to 2 complex pairs)

batch_size = 2
seq_len = 3
head_dim = 4

# xq shape: (batch_size, seq_len, head_dim)
xq = torch.randn(batch_size, seq_len, head_dim)

# xk shape: (batch_size, seq_len, head_dim)
xk = torch.randn(batch_size, seq_len, head_dim)

# When xq is reshaped to complex: reshape(*xq.shape[:-1], -1, 2) -> (batch, seq_len, head_dim//2)
# After view_as_complex, shape is (batch, seq_len, head_dim//2)
# So freqs_cis needs shape (seq_len, head_dim//2)
freqs_cis = torch.randn(seq_len, head_dim // 2, dtype=torch.complex64)

ARGS = {
    "xq": xq,
    "xk": xk,
    "freqs_cis": freqs_cis,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
eliminate_consecutive_duplicates Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aleflabo/PREGO/utils/aggregate.py
code served (permissive licence) · get_code("d003debd2df6cd68")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family int, shape (6,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a simple numpy array with some consecutive duplicates
arr = np.array([1, 1, 2, 2, 2, 3, 3, 4, 5, 5, 5, 5, 6])

ARGS = {
    "arr": arr
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (6,) — shape (6,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_changes Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aleflabo/PREGO/utils/aggregate.py
code served (permissive licence) · get_code("481e169e4642ae46")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a simple test array with some changes
arr = np.array([1, 1, 2, 2, 2, 3, 1, 1, 4])

ARGS = {
    "arr": arr
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_metrics Ran
ran; our contract draft was wrong, not the code
aleflabo/PREGO/step_anticipation/src/models/llama_meta.py
code served (permissive licence) · get_code("ded3bc4e3cdab571")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function:
# - preds: dict with keys, values are iterables of iterables (lists of lists)
# - gts: dict with keys, values are iterables of iterables (lists of lists)
# - The function iterates over gts.keys(), gets gt and pred for each key
# - Checks if each element in gt is in the corresponding element in pred
# - Processes matches array with correct = matches[:-1] and mistake = matches[-1]
# - This means matches needs at least 2 elements per key

# Construct minimal valid arguments
preds = {
    'sample1': [['a', 'b'], ['c']],
    'sample2': [['x'], ['y', 'z']]
}

gts = {
    'sample1': [['a'], ['d']],
    'sample2': [['x', 'w'], ['y']]
}

ARGS = {
    'preds': preds,
    'gts': gts
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_toy Ran
ran; our contract draft was wrong, not the code
aleflabo/PREGO/step_anticipation/src/models/llama_meta.py
code served (permissive licence) · get_code("cc516edf16453625")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

ARGS = {
    "name": "file-prefix-toy_suffix.txt"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_toy Ran
ran; our contract draft was wrong, not the code
aleflabo/PREGO/step_anticipation/src/models/llm_hf.py
code served (permissive licence) · get_code("5c2877e8bd1ddf2e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "name": "prefix-middle-toy_suffix"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_data Ran
ran; our contract draft was wrong, not the code
aleflabo/PREGO/step_anticipation/src/models/llama_meta.py
code served (permissive licence) · get_code("5c04ac9160c4312f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_data.json")

sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "data"}
}

with open(temp_file, 'w') as f:
    json.dump(sample_data, f)

ARGS = {
    "path": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_data Ran
ran; our contract draft was wrong, not the code
aleflabo/PREGO/step_anticipation/src/models/llm_hf.py
code served (permissive licence) · get_code("2fcc0c590f063c0c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "data.json")

sample_data = {
    "items": [
        {"id": 1, "name": "item1", "value": 42},
        {"id": 2, "name": "item2", "value": 100}
    ],
    "metadata": {
        "version": "1.0",
        "count": 2
    }
}

with open(temp_file, 'w') as f:
    json.dump(sample_data, f)

ARGS = {
    "path": temp_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
precompute_freqs_cis Ran
ran, violated the contract we drafted
aleflabo/PREGO/step_anticipation/llama/model.py
pointer only (licence: MIT); the stored copy get_code serves, from aleksandarpetrov/prefix-tuning-theory, is pointer only (licence: NONE) · get_code("9aef5cccb42aa073")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from aleksandarpetrov/prefix-tuning-theory, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

reshape_for_broadcast Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aleflabo/PREGO/step_anticipation/llama/model.py
pointer only (licence: MIT); the stored copy get_code serves, from aleksandarpetrov/prefix-tuning-theory, is pointer only (licence: NONE) · get_code("5a639d78ada17fee")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from aleksandarpetrov/prefix-tuning-theory, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

sample_top_p Ran
ran; our contract draft was wrong, not the code
aleflabo/PREGO/step_anticipation/llama/generation.py
pointer only (licence: MIT); the stored copy get_code serves, from qingyue2014/Rsum, is pointer only (licence: NONE) · get_code("e28848558038eee4")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from qingyue2014/Rsum, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 6 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 4 the same month, 6 later) and 3 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
reshape_for_broadcast 58 other papers
26 dated earlier, 2 the same month, 30 later · 2 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 55 more not named here
apply_rotary_emb 55 other papers
22 dated earlier, 2 the same month, 31 later · 1 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 52 more not named here
precompute_freqs_cis 47 other papers
22 dated earlier, 2 the same month, 23 later · 1 only as an assembly brick
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 44 more not named here
sample_top_p 26 other papers
14 dated earlier, 2 the same month, 9 later, 1 same year, order not determinable
2023.emnlp-main.534 (2023 (year only))
Disentangling Transformer Language Models as Superposed Topic Models
2305.08322 (2023-05)
C-EVAL: A Multi-Level Multi-Discipline Chinese Evaluation Suite for Foundation Models
2305.11554 (2023-05)
ToolkenGPT: Augmenting Frozen Language Models with Massive Tools via Tool Embeddings
and 23 more not named here
eliminate_consecutive_duplicates 1 other paper
1 later
2411.02570 (2024-11)
TI-PREGO: Chain of Thought and In-Context Learning for Online Mistake Detection in PRocedural EGOcentric Videos
find_changes 1 other paper
1 later
2411.02570 (2024-11)
TI-PREGO: Chain of Thought and In-Context Learning for Online Mistake Detection in PRocedural EGOcentric Videos

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

symbolic reasoning module to predict the next actions. Mistake detection is performed by comparing the recognized current action with the expected future one. We evaluate PREGO on two procedural egocentric video datasets, As-sembly101 and Epic-tent, which we adapt for online benchmarking of procedural mistake detection to establish suitable benchmarks, thus defining the Assembly101-O and Epic-tent-O datasets, respectively. The code is available at https://github.com/aleflabo/PREGO. * Authors contributed equally. ‡ Co-senior role. 1 Most workflows can be aided by online monitoring algorithms, which provide feedback to the operator in due course. However, they may lag due to processing or connectivity delays. We distinguish online from real-time, whereby the second has strict requirements of instantaneous response.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.01933")
get_code_for_paper("2404.01933")
have("2404.01933")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2404.01933.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2404.01933.svg)](https://syntology.ai/paper/2404.01933)

Connect an agent — have() is free.