SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.15122 · 2021

CAFE: Catastrophic Data Leakage in Vertical Federated Learning

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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 5 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2110.15122.json · badge: /api/ran/2110.15122.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
derafael/cafe canonical (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
FunctionStatusWhere it lives
compute_accuracy Ran
ran on a synthesized input
derafael/cafe/utils.py
code served (permissive licence) · get_code("778b9ea3a727c31d")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

# Create small sample data for compute_accuracy
batch_size = 2
num_classes = 4

# Create labels as one-hot encoded categorical labels
# Shape: (batch_size, num_classes)
labels = tf.constant([
    [1.0, 0.0, 0.0, 0.0],
    [0.0, 1.0, 0.0, 0.0]
], dtype=tf.float32)

# Create logits (raw model outputs before softmax)
# Shape: (batch_size, num_classes)
logits = tf.constant([
    [2.0, 1.0, 0.5, 0.1],
    [0.1, 2.5, 0.3, 0.2]
], dtype=tf.float32)

ARGS = {
    "labels": labels,
    "logits": logits
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
compute_loss Ran
ran on a synthesized input
derafael/cafe/utils.py
code served (permissive licence) · get_code("a7f22ab2c8e8dccd")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

# Set random seed for reproducibility
tf.random.set_seed(0)

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

# labels: shape (batch_size, num_classes) - one-hot encoded or probability distribution
labels = tf.constant([
    [1.0, 0.0, 0.0, 0.0],
    [0.0, 1.0, 0.0, 0.0]
], dtype=tf.float32)

# logits: shape (batch_size, num_classes) - raw model outputs
logits = tf.constant([
    [2.1, 1.5, 0.3, 0.1],
    [0.2, 2.3, 1.1, 0.5]
], dtype=tf.float32)

ARGS = {
    "labels": labels,
    "logits": logits
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
dummy_data_init Ran
ran on a synthesized input
derafael/cafe/utils.py
code served (permissive licence) · get_code("fc8c5619a11080bb")
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. 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
import tensorflow as tf

# Set seeds for reproducibility
np.random.seed(0)
tf.random.set_seed(0)

# Define arguments for dummy_data_init
ARGS = {
    'number_of_workers': 2,
    'data_number': 3,
    'pretrain': False,
    'true_label': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple 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
load_and_preprocess_image Ran
ran on a synthesized input
derafael/cafe/data_preprocess.py
code served (permissive licence) · get_code("1b6b9fd7caf0e0f8")
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 EagerTensor, ndim 3, dtype family float, shape (2, 2, 3) 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 tensorflow as tf
import tempfile
import os

# Create a temporary JPEG image file
with tempfile.TemporaryDirectory() as tmpdir:
    # Create a simple JPEG image
    image_array = tf.constant([[[255, 0, 0], [0, 255, 0]], [[0, 0, 255], [255, 255, 0]]], dtype=tf.uint8)
    encoded_image = tf.image.encode_jpeg(image_array)
    
    image_path = os.path.join(tmpdir, "test_image.jpg")
    with open(image_path, 'wb') as f:
        f.write(encoded_image.numpy())
    
    # Read the path as a string for the function argument
    path_string = image_path
    
    # Verify the path exists and is readable
    assert os.path.exists(path_string), f"Image path {path_string} does not exist"

# Since we need to pass a path that will be available when ARGS is used,
# we'll create a persistent temporary file
import atexit
tmpfile = tempfile.NamedTemporaryFile(suffix='.jpg', delete=False)
image_array = tf.constant([[[255, 0, 0], [0, 255, 0]], [[0, 0, 255], [255, 255, 0]]], dtype=tf.uint8)
encoded_image = tf.image.encode_jpeg(image_array)
tmpfile.write(encoded_image.numpy())
tmpfile.close()

# Clean up the temp file when done
atexit.register(lambda: os.unlink(tmpfile.name))

ARGS = {
    'path': tmpfile.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (2, 2, 3) — shape (2, 2, 3) 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
preprocess_image Ran
ran on a synthesized input
derafael/cafe/data_preprocess.py
code served (permissive licence) · get_code("7d871e6b3dc081d9")
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 EagerTensor, ndim 3, dtype family float, shape (2, 2, 3) 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 tensorflow as tf
import io

# Create a small valid JPEG image in memory
# This creates a minimal but valid JPEG byte string
def create_test_jpeg():
    # Create a small 2x2 RGB image as numpy array
    import numpy as np
    img_array = np.random.randint(0, 256, (2, 2, 3), dtype=np.uint8)
    
    # Convert to PIL Image, then to JPEG bytes
    from PIL import Image
    img = Image.fromarray(img_array, 'RGB')
    jpeg_buffer = io.BytesIO()
    img.save(jpeg_buffer, format='JPEG')
    jpeg_bytes = jpeg_buffer.getvalue()
    
    return jpeg_bytes

# Generate test JPEG image
test_jpeg = create_test_jpeg()

# Create the image as a TensorFlow string tensor (this is what the function expects)
image = tf.constant(test_jpeg)

ARGS = {
    'image': image
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 3, dtype family float, shape (2, 2, 3) — shape (2, 2, 3) 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
cafe_middle_input Not yet run
unverified (harvested, no recorded run)
derafael/cafe/double_shot.py
code served (permissive licence) · get_code("130ca908ed948ac1")
How it ran

no invocation recorded.

cafe_middle_output_gradient Not yet run
unverified (harvested, no recorded run)
derafael/cafe/first_shot.py
code served (permissive licence) · get_code("d1b33a7ec5011fb2")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
derafael/cafe/data_preprocess.py
code served (permissive licence) · get_code("0ca8b324119af42c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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.

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

Recent studies show that private training data can be leaked through the gradients sharing mechanism deployed in distributed machine learning systems, such as federated learning (FL). Increasing batch size to complicate data recovery is often viewed as a promising defense strategy against data leakage. In this paper, we revisit this defense premise and propose an advanced data leakage attack with theoretical justification to efficiently recover batch data from the shared aggregated gradients. We name our proposed method as catastrophic data leakage in vertical federated learning (CAFE). Comparing to existing data leakage attacks, our extensive experimental results on vertical FL settings demonstrate the effectiveness of CAFE to perform large-batch data leakage attack with improved data recovery quality. We also propose a practical countermeasure to mitigate CAFE. Our results suggest that private data participated in standard FL, especially the vertical case, have a high risk of being leaked from the training gradients. Our analysis implies unprecedented and practical data leakage risks in those learning settings. The code of our work is available at https://github.com/DeRafael/CAFE.

For agents

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

get_harvested_code_for_paper("2110.15122")
get_code_for_paper("2110.15122")
have("2110.15122")

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

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

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

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

Connect an agent — have() is free.