SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.02561 · ACL · 2023

LLM-BL E N D E R: Ensembling Large Language Models with Pairwise Ranking and Generative Fusion

Dongfu Jiang, Xiang, Ren ∫π

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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 7 have no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-23; 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/2306.02561.json · badge: /api/ran/2306.02561.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
yuchenlin/LLM-Blender canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
ListMLE_loss Ran
ran on a synthesized input
yuchenlin/LLM-Blender/llm_blender/pair_ranker/loss.py
code served (permissive licence) · get_code("6c3c4fd80392b2b3")
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 0, dtype family float, shape () 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

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
n_candidates = 4

# pred_scores: [batch_size, n_candidates]
pred_scores = torch.randn(batch_size, n_candidates)

# scores: [batch_size, n_candidates]
scores = torch.randn(batch_size, n_candidates)

ARGS = {
    "pred_scores": pred_scores,
    "scores": scores,
}
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 0, dtype family float, shape () — shape () 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
ListNet_loss Ran
ran on a synthesized input
yuchenlin/LLM-Blender/llm_blender/pair_ranker/loss.py
code served (permissive licence) · get_code("918c37e6d590c221")
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 0, dtype family float, shape () 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

torch.manual_seed(0)

# Create small tensors for the function
batch_size = 2
n_candidates = 4

# pred_scores: [batch_size, n_candidates] - predicted scores
pred_scores = torch.randn(batch_size, n_candidates, requires_grad=True)

# scores: [batch_size, n_candidates] - ground truth scores
scores = torch.randn(batch_size, n_candidates)

# top_k_permutation: int - top k permutation level
top_k_permutation = 2

ARGS = {
    "pred_scores": pred_scores,
    "scores": scores,
    "top_k_permutation": top_k_permutation,
}
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 0, dtype family float, shape () — shape () 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
beam_search_step Ran
ran on a synthesized input
yuchenlin/LLM-Blender/llm_blender/candidates_generation/engine.py
code served (permissive licence) · get_code("59209a93cb9f6249")
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 torch
import torch.nn as nn
from transformers import StoppingCriteria, StoppingCriteriaList
from typing import List

torch.manual_seed(0)

# Stand-in tokenizer class
class StandInTokenizer:
    def __init__(self):
        self.eos_token_id = 2
    
    def decode(self, token_ids, skip_special_tokens=False, clean_up_tokenization_spaces=False):
        return "generated text " + " ".join(str(t) for t in token_ids)

# Stand-in model class
class StandInModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embed = nn.Embedding(100, 8)
    
    def generate(self, input_ids, attention_mask=None, num_beams=1, num_return_sequences=1, 
                 max_new_tokens=10, repetition_penalty=1.0, length_penalty=1.0, 
                 no_repeat_ngram_size=0, use_cache=True, early_stopping=True, 
                 temperature=1.0, num_beam_groups=None, diversity_penalty=None, 
                 do_sample=False, top_p=None, top_k=None, return_dict_in_generate=False, 
                 output_scores=False, stopping_criteria=None, **kwargs):
        batch_size = input_ids.shape[0]
        num_return = num_return_sequences
        seq_len = max_new_tokens
        vocab_size = 100
        
        # Create mock scores (one per generated token, per sequence)
        scores = tuple(
            torch.randn(batch_size * num_return, vocab_size)
            for _ in range(seq_len)
        )
        
        # Create mock sequences
        sequences = torch.randint(3, 99, (batch_size * num_return, seq_len + input_ids.shape[1]))
        
        # Simple mock output object
        class MockOutput:
            def __init__(self, sequences, scores):
                self.sequences = sequences
                self.scores = scores
        
        return MockOutput(sequences=sequences, scores=scores)

# Stand-in args class
class StandInArgs:
    def __init__(self):
        self.decoding_method = 'beam_search'
        self.num_beams = 2
        self.num_return_sequences = 2
        self.output_max_length = 5
        self.repetition_penalty = 1.0
        self.length_penalty = 1.0
        self.no_repeat_ngram_size = 2
        self.temperature = 1.0
        self.num_beam_groups = 2
        self.diversity_penalty = 0.5
        self.top_p = 0.9
        self.top_k = 50
        self.stop_token_ids = [2]
        self.stop_str = None

# Construct arguments
input_ids = torch.randint(3, 99, (2, 4))
attention_mask = torch.ones(2, 4, dtype=torch.long)
tokenizer = StandInTokenizer()
base_model = StandInModel()
args = StandInArgs()

ARGS = {
    'input_ids': input_ids,
    'attention_mask': attention_mask,
    'tokenizer': tokenizer,
    'base_model': base_model,
    'args': args,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — 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
build_model Ran
ran on a synthesized input
yuchenlin/LLM-Blender/llm_blender/candidates_generation/model_utils.py
code served (permissive licence) · get_code("f959a13305017609")
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 Linear. 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 unittest.mock import Mock, patch
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForCausalLM, AutoModel

torch.manual_seed(0)

# Mock the from_pretrained methods to avoid actual model downloads
def mock_causal_lm_from_pretrained(model_name, **kwargs):
    model = nn.Linear(10, 10)
    return model

def mock_seq2seq_lm_from_pretrained(model_name, **kwargs):
    model = nn.Linear(10, 10)
    return model

def mock_auto_model_from_pretrained(model_name, **kwargs):
    model = nn.Linear(10, 10)
    return model

# Patch the from_pretrained methods
AutoModelForCausalLM.from_pretrained = mock_causal_lm_from_pretrained
AutoModelForSeq2SeqLM.from_pretrained = mock_seq2seq_lm_from_pretrained
AutoModel.from_pretrained = mock_auto_model_from_pretrained

# Define ARGS for the build_model function
ARGS = {
    'model_name': 'llama-7b',
    'kwargs': {
        'torch_dtype': torch.float32,
        'device_map': 'cpu',
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
build_tokenizer Ran
ran on a synthesized input
yuchenlin/LLM-Blender/llm_blender/candidates_generation/model_utils.py
code served (permissive licence) · get_code("9e63c7f428bcf976")
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 Mock. 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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock tokenizer that will be returned by AutoTokenizer.from_pretrained
mock_tokenizer = Mock()
mock_tokenizer.pad_token = None
mock_tokenizer.eos_token = "<|endoftext|>"
mock_tokenizer.eos_token_id = 50256
mock_tokenizer.pad_token_id = None
mock_tokenizer.name_or_path = "mock-model"

# Patch AutoTokenizer to return our mock
from transformers import AutoTokenizer
original_from_pretrained = AutoTokenizer.from_pretrained

def mock_from_pretrained(model_name, **kwargs):
    """Mock implementation that returns a configured tokenizer"""
    tokenizer = Mock()
    tokenizer.pad_token = None
    tokenizer.eos_token = "<|endoftext|>"
    tokenizer.eos_token_id = 50256
    tokenizer.pad_token_id = None
    tokenizer.name_or_path = model_name
    return tokenizer

AutoTokenizer.from_pretrained = mock_from_pretrained

ARGS = {
    'model_name': 'alpaca-7b',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Mock — a Mock output has no array shape of its own; none is 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
build_tokenizer Ran
ran on a synthesized input
yuchenlin/LLM-Blender/llm_blender/pair_ranker/model_util.py
code served (permissive licence) · get_code("dea0c7d7d27028b1")
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 MockTokenizer. 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
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock tokenizer class that satisfies the function's usage patterns
class MockTokenizer:
    def __init__(self):
        self.pad_token = None
        self.eos_token = "<eos>"
        self.eos_token_id = 50256
        self.pad_token_id = None
        self.unk_token = "<unk>"
        self.truncation_side = "right"
    
    def add_special_tokens(self, tokens_dict):
        pass

# Mock AutoTokenizer.from_pretrained to return our mock tokenizer
import transformers
original_from_pretrained = transformers.AutoTokenizer.from_pretrained

def mock_from_pretrained(model_name, **kwargs):
    return MockTokenizer()

transformers.AutoTokenizer.from_pretrained = staticmethod(mock_from_pretrained)

ARGS = {
    'model_name': 'bert-base-uncased',
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockTokenizer — a MockTokenizer output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockTokenizer 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_torch_dtype Ran
ran; our contract draft was wrong, not the code
yuchenlin/LLM-Blender/llm_blender/blender/blender_utils.py
code served (permissive licence) · get_code("81990a380398703e")
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 dtype. 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)

# The function takes a single parameter: dtype_str
# It simply checks if dtype_str matches certain string values and returns the corresponding torch dtype
# No complex objects needed - just a string argument

ARGS = {
    'dtype_str': 'float32'
}
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 dtype — a dtype output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dtype 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
permutation_prob Ran
ran on a synthesized input
yuchenlin/LLM-Blender/llm_blender/pair_ranker/loss.py
code served (permissive licence) · get_code("c92f69693fc7c0e9")
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 2, dtype family float, shape (2, 12) 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

torch.manual_seed(0)

# Create a simple scores tensor with shape [batch_size=2, n_candidates=4]
scores = torch.tensor([
    [0.1, 0.2, 0.3, 0.4],
    [0.5, 0.1, 0.2, 0.2]
], dtype=torch.float32)

# Define arguments for the function
ARGS = {
    'scores': scores,
    'level': 2
}
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 2, dtype family float, shape (2, 12) — shape (2, 12) 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
build_pretrained_model Not yet run
unverified (harvested, no recorded run)
yuchenlin/LLM-Blender/llm_blender/pair_ranker/model_util.py
code served (permissive licence) · get_code("c6530fc447002e2f")
How it ran

no invocation recorded.

build_ranker Not yet run
unverified (harvested, no recorded run)
yuchenlin/LLM-Blender/llm_blender/pair_ranker/model_util.py
code served (permissive licence) · get_code("55761e9e27661128")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 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 9 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
get_torch_dtype 1 other paper
1 later
2310.00752 (2023-10)
TIGERScore: Towards Building Explainable Metric for All Text Generation Tasks

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

Repositories linked to this paper

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

Abstract

We present LLM-BL E N D E R, an ensembling framework designed to attain consistently superior performance by leveraging the diverse strengths of multiple open-source large language models (LLMs). Our framework consists of two modules: PAIRRANKER and GEN-FUSER, addressing the observation that optimal LLMs for different examples can significantly vary. PAIRRANKER employs a specialized pairwise comparison method to distinguish subtle differences between candidate outputs. It jointly encodes the input text and a pair of candidates, using cross-attention encoders to determine the superior one. Our results demonstrate that PAIRRANKER exhibits the highest correlation with ChatGPT-based ranking. Then, GENFUSER aims to merge the top-ranked candidates, generating an improved output by capitalizing on their strengths and mitigating their weaknesses. To facilitate largescale evaluation, we introduce a benchmark dataset, MixInstruct, which is a mixture of multiple instruction datasets featuring oracle pairwise comparisons. Our LLM-BL E N D E R significantly outperform individual LLMs and baseline methods across various metrics, establishing a substantial performance gap.

For agents

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

get_harvested_code_for_paper("2306.02561")
get_code_for_paper("2306.02561")
have("2306.02561")

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

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

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

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

Connect an agent — have() is free.