SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-acl.85 · ACL Findings · 2024

RIFF: Learning to Rephrase Inputs for Few-shot Fine-tuning of Language Models

Saeed Najafi, A. Fyshe

Code that ran

5 of 12 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, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 7 no recorded run), measured 2026-11-24; 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/2024.findings-acl.85.json · badge: /api/ran/2024.findings-acl.85.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
SaeedNajafi/RIFF canonical (classifier label)
classifier basis: census
5 ran · 7 no recorded run
FunctionStatusWhere it lives
all_weights_opt Ran
ran on a synthesized input
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/prompt_optimizers.py
code served (permissive licence) · get_code("844e00f01bc1f4ee")
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 AdamW. 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
import torch.nn as nn
from absl import flags
from typing import Dict, Optional

# Set up flags
FLAGS = flags.FLAGS
flags.DEFINE_float('learning_rate', 1e-4, 'Learning rate')
flags.DEFINE_float('weight_decay_rate', 1e-5, 'Weight decay rate')

# Mark flags as parsed to avoid issues
FLAGS.mark_as_parsed()

torch.manual_seed(0)

# Create a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create model instances
model_bert = MinimalModel()

# Construct the arguments dictionary
ARGS = {
    'opt_args': {
        'bert_model': model_bert
    },
    'lm_type': 'bert'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
absl, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AdamW — a AdamW output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AdamW 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
construct_optimizer Ran
ran on a synthesized input
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/prompt_optimizers.py
code served (permissive licence) · get_code("27fc72685c0e3a1d")
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 AdamW. 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
import torch.nn as nn
from absl import flags
from typing import Optional

FLAGS = flags.FLAGS

# Define required FLAGS
flags.DEFINE_float('learning_rate', 0.001, 'Learning rate')
flags.DEFINE_float('weight_decay_rate', 0.0001, 'Weight decay rate')

# Parse flags (needed to set them)
FLAGS([""])

torch.manual_seed(0)

# Create a minimal model
class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Create models
model = TinyModel()
second_model = TinyModel()

ARGS = {
    "model": model,
    "second_model": second_model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
absl, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AdamW — a AdamW output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AdamW 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
mlm_logits Ran
ran on a synthesized input
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/model_utility.py
code served (permissive licence) · get_code("6de33a9aaa6ea41a")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 100) 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 torch
import torch.nn as nn

torch.manual_seed(0)

class MockMLMModel(nn.Module):
    """Minimal MLM model that returns logits"""
    def __init__(self, vocab_size=100, hidden_size=4):
        super().__init__()
        self.embedding = nn.Embedding(vocab_size, hidden_size)
        self.linear = nn.Linear(hidden_size, vocab_size)
    
    def forward(self, input_ids, attention_mask=None, labels=None):
        """Forward pass returning output with logits attribute"""
        x = self.embedding(input_ids)
        logits = self.linear(x)
        
        class Output:
            pass
        
        output = Output()
        output.logits = logits
        return output

# Create mock model
model = MockMLMModel(vocab_size=100, hidden_size=4)

# Create input tensors
batch_size = 2
seq_length = 3
input_ids = torch.randint(0, 100, (batch_size, seq_length))
input_mask = torch.ones((batch_size, seq_length), dtype=torch.long)

ARGS = {
    "model": model,
    "input_ids": input_ids,
    "input_mask": input_mask,
}
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 Tensor, ndim 3, dtype family float, shape (2, 3, 100) — shape (2, 3, 100) 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
postprocess_label Ran
ran on a synthesized input
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/metrics.py
code served (permissive licence) · get_code("755898ab74ebc1ec")
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

def postprocess_label(label: str) -> str:
    label = label.removesuffix('</s>')
    label = label.removeprefix('<s>')
    label = label.strip()
    return label

ARGS = {
    'label': '<s>hello world</s>'
}
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
white_space_fix Ran
ran; our contract draft was wrong, not the code
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/data_utility.py
code served (permissive licence) · get_code("5645d949d53a998b")
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)

text_input = "This   is  a   test  with   extra    spaces"

ARGS = {
    "text": text_input
}
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
create_softprompt_roberta Not yet run
unverified (harvested, no recorded run)
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/soft_prompt_modules.py
code served (permissive licence) · get_code("290231fda04bcc0b")
How it ran

no invocation recorded.

input_embeddings_opt Not yet run
unverified (harvested, no recorded run)
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/prompt_optimizers.py
code served (permissive licence) · get_code("3bcaba18ecd4510d")
How it ran

no invocation recorded.

log_of_labels Not yet run
unverified (harvested, no recorded run)
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/model_utility.py
code served (permissive licence) · get_code("af21cb18dece64d1")
How it ran

no invocation recorded.

prepend_prompt Not yet run
unverified (harvested, no recorded run)
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/model_utility.py
code served (permissive licence) · get_code("50e9838ad4b00067")
How it ran

no invocation recorded.

read_fewshot_file Not yet run
unverified (harvested, no recorded run)
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/data_utility.py
code served (permissive licence) · get_code("3bffd34a98339ad2")
How it ran

no invocation recorded.

sentiment_metric Not yet run
unverified (harvested, no recorded run)
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/metrics.py
code served (permissive licence) · get_code("8d9638bbe51ee784")
How it ran

no invocation recorded.

template_data Not yet run
unverified (harvested, no recorded run)
SaeedNajafi/RIFF/src/reference_implementations/prompt_zoo/data_utility.py
code served (permissive licence) · get_code("bf88eb4025f0d64f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
white_space_fix 2 other papers
1 later, 1 same year, order not determinable
2401.14887 (2024-01)
The Power of Noise: Redefining Retrieval for RAG Systems
2607.03615 (2026-07)
The Powerless Noise: How Experimental Settings Shape the Reported Power of Noise

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-24.

Repositories linked to this paper

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

Abstract

Pre-trained Language Models (PLMs) can be accurately fine-tuned for downstream text processing tasks. Recently, researchers have introduced several parameter-efficient fine-tuning methods that optimize input prompts or adjust a small number of model parameters (e.g LoRA). In this study, we explore the impact of altering the input text of the original task in conjunction with parameter-efficient finetuning methods. To most effectively rewrite the input text, we train a few-shot paraphrase model with a Marginal Maximum Likelihood objective. Using six few-shot text classification datasets, we show that enriching data with paraphrases at train and test time enhances the performance beyond what can be achieved with parameter-efficient fine-tuning alone. The code used for our experiments can be found at https://github.com/SaeedNajafi/RIFF.

For agents

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

get_harvested_code_for_paper("2024.findings-acl.85")
get_code_for_paper("2024.findings-acl.85")
have("2024.findings-acl.85")

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

curl https://syntology.ai/api/ran/2024.findings-acl.85.json

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

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-acl.85.svg)](https://syntology.ai/paper/2024.findings-acl.85)

Connect an agent — have() is free.