SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2510.26311 · NeurIPS · 2025

Model Inversion with Layer-Specific Modeling and Alignment for Data-Free Continual Learning

Dong Gong, Yuhang Liu, Haodong Lu, Ruilin Tong

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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 3 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-22; 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/2510.26311.json · badge: /api/ran/2510.26311.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
RuilinTong/PMI-CFS-DFCL community
Papers with Code archive
4 ran · 3 no recorded run
FunctionStatusWhere it lives
CLIPLoss Ran
ran on a synthesized input
RuilinTong/PMI-CFS-DFCL/CLIP/inversion/layer_wise_clip_inversion.py
code served (permissive licence) · get_code("844956b037652749")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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

INIT_ARGS = {
    'reduction': 'mean'
}

ARGS = {
    'x': torch.randn(2, 4),
    'y': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = torch.nn.Module()
    
    class CLIPLoss(torch.nn.Module):
        def __init__(self, reduction='mean'):
            super().__init__()
            self.reduction = reduction

        def forward(self, x, y):
            loss = torch.norm(x - y, dim=1, p=2)
            if self.reduction == 'mean':
                loss = torch.mean(loss)
            elif self.reduction == 'sum':
                loss = torch.sum(loss)
            return loss
    
    clip_loss = CLIPLoss(**INIT_ARGS)
    output = clip_loss(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output value: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
CosineLoss Ran
ran on a synthesized input
RuilinTong/PMI-CFS-DFCL/CLIP/inversion/layer_wise_clip_inversion.py
code served (permissive licence) · get_code("d4023d1f5f50f087")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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

INIT_ARGS = {
    'reduction': 'mean'
}

ARGS = {
    'x': torch.randn(2, 4),
    'y': torch.randn(2, 4)
}

if __name__ == '__main__':
    loss_fn = torch.nn.CosineLoss(**INIT_ARGS)
    output = loss_fn(**ARGS)
    print(output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
KLDivergence Ran
ran on a synthesized input
RuilinTong/PMI-CFS-DFCL/CLIP/inversion/layer_wise_clip_inversion.py
code served (permissive licence) · get_code("f0b914d4ef2febe4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import numpy as np

# INIT_ARGS for KLDivergence.__init__
INIT_ARGS = {
    'mean': torch.randn(4),  # feature dim 4
    'var': torch.ones(4),    # feature dim 4
    'batch_dim': 0           # batch dimension is 0
}

# ARGS for KLDivergence.compute_loss
# Construct input tensor with shape (batch=2, channels=4, height=3, width=3)
ARGS = {
    'x': torch.randn(2, 4, 3, 3)
}

# METHOD is 'compute_loss' since that's the computation method
METHOD = 'compute_loss'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
regularize_input Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
RuilinTong/PMI-CFS-DFCL/CLIP/inversion/layer_wise_clip_inversion.py
code served (permissive licence) · get_code("c9d774b97e90f6c3")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 5) 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 tensor with requires_grad=True so it has a .data attribute
# Shape: (batch=2, channels=3, height=4, width=5)
inputs = torch.randn(2, 3, 4, 5, requires_grad=True)

# Test with 'clip' clip_type
clip_type = 'clip'

ARGS = {
    'inputs': inputs,
    'clip_type': clip_type
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) 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
InputShapeHook Not yet run
unverified (harvested, no recorded run)
RuilinTong/PMI-CFS-DFCL/CLIP/inversion/layer_wise_clip_inversion.py
code served (permissive licence) · get_code("a0f649cecdd35c4c")
How it ran

no invocation recorded.

LayerWiseCLIPInversion Not yet run
unverified (harvested, no recorded run)
RuilinTong/PMI-CFS-DFCL/CLIP/inversion/layer_wise_clip_inversion.py
code served (permissive licence) · get_code("c21d2f59c4c85af2")
How it ran

no invocation recorded.

save_images Not yet run
unverified (harvested, no recorded run)
RuilinTong/PMI-CFS-DFCL/CLIP/inversion/layer_wise_clip_inversion.py
code served (permissive licence) · get_code("d221295c5e9328e2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 7 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-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

Continual learning (CL) aims to incrementally train a model to a sequence of tasks while maintaining performance on previously seen ones. Despite mitigating forgetting, data storage and replay are often infeasible due to privacy or security constraints and are impractical for arbitrary pre-trained models. Data-free or examplar-free CL aims to continually update models with new tasks without storing previous data. In addition to regularizing updates, we employ model inversion to synthesize data from the trained model, anchoring learned knowledge through replay without retaining old data. However, model inversion in predictive models faces two key challenges. First, generating inputs (e.g., images) solely from highly compressed output labels (e.g., classes) often causes drift between synthetic and real data. Replaying on such synthetic data can contaminate and erode knowledge learned from real data, further degrading inversion quality over time. Second, performing inversion is usually computationally expensive, as each iteration requires backpropagation through the entire model and many steps are needed for convergence. These problems are more severe with large pre-trained models such as Contrastive Language-Image Pre-training (CLIP) models. To improve model inversion efficiency, we propose Per-layer Model Inversion (PMI) approach inspired by the faster convergence of single-layer optimization. The inputs optimized from PMI provide strong initialization for full-model inversion, significantly reducing the number of iterations required for convergence. To address feature distribution shift, we model class-wise feature distribution using a Gaussian distribution and preserve distributional information with a contrastive model. Sampling features for inversion ensures alignment between synthetic and real feature distributions. Combining PMI and feature modeling, we demonstrate the feasibility of incrementally training models on new classes by generating data from pseudo image features mapped through semantic-aware feature projection. Our method shows strong effectiveness and compatibility across multiple CL settings. Code is available at https://github.com/RuilinTong/PMI-CFS-DFCL.

For agents

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

get_harvested_code_for_paper("2510.26311")
get_code_for_paper("2510.26311")
have("2510.26311")

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

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

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

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

Connect an agent — have() is free.