abliteration.org
Get the app

Two ways to read this site

Technical mode is the default: exact terms and codes, for engineers, researchers, journalists and companies. Simple mode gives the same facts in plain words, for anyone who wants a model that runs on their own computer. You can switch at any time at the top of the page.

technical
MLX weights for Apple silicon (M1 or later), usually quantized to 4 or 8 bits.
simple
Made for Macs with Apple silicon (M1 or newer), usually compressed to 4 or 8 bits.

EleutherAI/fake-cifar10

published by @EleutherAI

Refusal-direction material, activation probes, steering and concept-erasure data.Data on the refusal signal, a pattern inside the model linked to refusing.

size_categories:10K<n<100Kformat:parquetmodality:imagelibrary:datasetslibrary:pandaslibrary:mlcroissantlibrary:polarsregion:us
Lifetime downloads
745
Last 30 days
72
Likes
-
Size
158.8 MB

Description

This is a dataset of "fake" CIFAR-10 images which were sampled from a high-entropy distribution whose

mean and covariance matrix matches that of the original CIFAR-10. It was generated with the following code:

from datasets import ClassLabel, Dataset, DatasetDict, Features, Image, load_dataset

from functools import partial

def generator(split: str):

from datasets import Dataset

from concept_erasure import assert_type, groupby, optimal_linear_shrinkage

from… See the full description on the dataset page: https://huggingface.co/datasets/EleutherAI/fake-cifar10.

Structure 1 config · from the README front matter1 subset, from the author's description

default default 60,000 rows
SplitPartRowsSize
train 50,000 125.2 MB
test 10,000 25.2 MB
FeaturesFields
imgimage label
Data files
train data/train-*
test data/test-*

Used by uncensored models none yet

No abliterated models in our catalog have declared this dataset in their YAML metadata yet. This can mean the dataset is used but not declared, is used outside abliteration workflows, or is new. The link will populate automatically as models are indexed.No model in our catalog lists this dataset yet. It may be used without being listed, used for other work, or simply be new. The list fills in by itself as models are added.

MetadataDetails

Created on HFCreated
2024-01-27 · 2 years ago
Size category
10K<n<100K
ModalitiesData types
image
Formats
parquet
LibrariesTools
datasetspandasmlcroissantpolars

Related datasets same stage · Ablatesame step · Removing refusals

Read further

Total size
158.8 MB
Files
4
Formats
parquet
Head
f111a67
Last updated on HFLast updated
2024-01-27

Download the dataset

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.Each of these lines of code downloads the dataset straight from Hugging Face, with your own Hugging Face login.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("EleutherAI/fake-cifar10")
Raw snapshot (Python)All files (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="EleutherAI/fake-cifar10", repo_type="dataset")
git clone (requires git-lfs)With git (needs git-lfs)
git clone https://huggingface.co/datasets/EleutherAI/fake-cifar10

Files by folder from our last crawlfrom our last check

top level 2 files 6.0 KB
.gitattributes 2.3 KB file download
README.md 3.7 KB md download
data/ 2 files 158.8 MB
test-00000-of-00001.parquet 26.7 MB parquet download
train-00000-of-00001.parquet 132.2 MB parquet download

READMEAuthor's description current version from Hugging Faceas it is now on Hugging Face

This is a dataset of "fake" CIFAR-10 images which were sampled from a high-entropy distribution whose
mean and covariance matrix matches that of the original CIFAR-10. It was generated with the following code:

from datasets import ClassLabel, Dataset, DatasetDict, Features, Image, load_dataset
from functools import partial


def generator(split: str):
    from datasets import Dataset
    from concept_erasure import assert_type, groupby, optimal_linear_shrinkage
    from concept_erasure.optimal_transport import psd_sqrt
    from PIL import Image as PilImage
    from torch import nn, optim, Tensor
    import torch

    def koleo(x: Tensor) -> Tensor:
        """Kozachenko-Leonenko estimator of entropy."""
        return torch.cdist(x, x).kthvalue(2).values.log().mean()

    def hypercube_sample(
        n: int,
        mean: Tensor,
        cov: Tensor,
        *,
        koleo_weight: float = 1e-3,
        max_iter: int = 100,
        seed: int = 0,
    ):
        """Generate `n` samples from a distribution on [0, 1]^d with the given moments."""

        d = mean.shape[-1]
        assert d == cov.shape[-1] == cov.shape[-2], "Dimension mismatch"
        assert n > 1, "Need at least two samples to compute covariance"

        eps = torch.finfo(mean.dtype).eps
        rng = torch.Generator(device=mean.device).manual_seed(seed)

        # Initialize with max-ent samples matching `mean` and `cov` but without hypercube
        # constraint. We do so in a way that is robust to singular `cov`
        z = mean.new_empty([n, d]).normal_(generator=rng)
        x = torch.clamp(z @ psd_sqrt(cov) + mean, eps, 1 - eps)

        # Reparametrize to enforce hypercube constraint
        z = nn.Parameter(x.logit())
        opt = optim.LBFGS([z], line_search_fn="strong_wolfe", max_iter=max_iter)

        def closure():
            opt.zero_grad()
            x = z.sigmoid()

            loss = torch.norm(x.mean(0) - mean) + torch.norm(x.T.cov() - cov)
            loss -= koleo_weight * koleo(x)
            loss.backward()
            return float(loss)

        opt.step(closure)
        return z.sigmoid().detach()

    ds = assert_type(Dataset, load_dataset("cifar10", split=split))

    with ds.formatted_as("torch"):
        X = assert_type(Tensor, ds["image"]).div(255).cuda()
        Y = assert_type(Tensor, ds["label"]).cuda()

    # Iterate over the classes
    for y, x in groupby(X, Y):
        mean = x.flatten(1).mean(0)
        cov = optimal_linear_shrinkage(x.flatten(1).mT.cov(), len(x))

        for fake_x in hypercube_sample(len(x), mean, cov).reshape_as(x).mul(255).cpu():
            yield {"image": PilImage.fromarray(fake_x.numpy()).convert("RGB"), "label": y}

features = Features({
    "image": Image(),
    "label": ClassLabel(num_classes=10),
})
fake_train = Dataset.from_generator(partial(generator, "train"), features)
fake_test = Dataset.from_generator(partial(generator, "test"), features)
fake = DatasetDict({"train": fake_train, "test": fake_test})
fake.push_to_hub("EleutherAI/fake-cifar10")

README historyEdit history 4 revisions4 edits

Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.Every night we save the author's description of every dataset in the catalog. When it changes, we keep the new text and compare it with the one before. This shows what each author chose to say about their dataset, and how that changed over time.

  1. 2024-01-27 Update README.md f111a67 3.6 KB
    Loading...
  2. 2024-01-27 Update README.md a826ba6 3.6 KB
    Loading...
  3. 2024-01-27 Upload dataset a919e85 657 B
    Loading...
  4. 2024-01-27 initial commit ec478e0 0 B
    Loading...
Download from Hugging Face

EleutherAI/fake-cifar10

Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every GGUF model page has an "Open in Abliteration" button that lets you pick a file, then opens it in the desktop app. No API keys, no subscription, no prompt leakage.Each model page in the format the app uses has an "Open in Abliteration" button to open a file in the desktop app. No API keys, no subscription, your requests stay on your computer.

Open in Abliteration