No-op LoRA, Incomplete and Inconsistent records: Is this just pure fraud?

#11
by Shom012 - opened

The public artifacts do not support the claims made in the model card. The LoRA adapter is a strict no-op, the configuration files contradict each other, the full-model shard set appears incomplete, and the repository history shows repeated weight-file deletion/upload activity. Taken together, this raises a serious question about whether the advertised model exists in the form claimed here.

Core issue: the adapter is a PEFT default initialization

The published adapter_model.safetensors is mathematically equivalent to a fresh PEFT LoRA initialization:

  • all lora_A tensors are nonzero and have Kaiming-uniform initialization scale;
  • all lora_B tensors are exactly zero;
  • therefore every LoRA update is exactly zero:
Delta W = (alpha / r) * B @ A = 0

That means the adapter contributes nothing to the base model. It is not a trained LoRA adapter in any meaningful sense.

PEFT documents this exact default initialization: Kaiming-uniform for weight A and zeros for weight B, producing an identity/no-op transform:

https://github.com/huggingface/peft/blob/main/docs/source/package_reference/lora.md#initialization

The current adapter matches that fingerprint exactly.

The metadata contradicts itself

The model card describes a trained/distilled model with SFT and GRPO, and claims LoRA settings such as rank 64, alpha 128, dropout 0.05, BF16 parameters, and about 0.94B trainable parameters.

The actual public files say something else:

Source Values
Model card training section rank 64, alpha 128, dropout 0.05, BF16, 0.94B trainable params, SFT + GRPO
adapter_config.json rank 16, alpha 32, dropout 0.1, init_lora_weights=true, PEFT 0.19.1
merge_info.json rank 8, alpha 16, scaling 2.0, 47 shards
Actual adapter tensors rank 16, F32, 17,338,368 params, all lora_B tensors exactly zero
Actual repo tree 42 model shards present, while the index references 47

These cannot all be descriptions of the same trained model.

The full model shard set is incomplete

The repository currently exposes 42 model-*.safetensors files, but model.safetensors.index.json references 47 shard files. The missing referenced files are:

model-00043-of-00047.safetensors
model-00044-of-00047.safetensors
model-00045-of-00047.safetensors
model-00046-of-00047.safetensors
model-00047-of-00047.safetensors

So even if the intended artifact is the merged/full model rather than the adapter, the currently published shard set is not self-consistent.

Repository history makes the authenticity concern worse

The recent Hugging Face commit history shows repeated weight-file churn, not a clean model release:

  • in the latest 50 commits returned by the HF API, 34 commit titles mention safetensors;
  • 41 of those 50 commit titles are delete operations;
  • 7 are upload operations;
  • on 2026-06-23 around 17:55-17:56 UTC, the repo deleted DeepSeek-V4-Flash-00001-of-00032.safetensors through DeepSeek-V4-Flash-00032-of-00032.safetensors plus DeepSeek-V4-Flash.index.json;
  • the repo then presents a different model-xxxxx-of-00047.safetensors layout, but the current tree still lacks 5 shards referenced by the index.

This history does not prove intent, but it absolutely requires an explanation. When a model claims SFT + GRPO training, 0.94B trainable LoRA parameters, and security-agent capability, but the published adapter is a zero-delta PEFT initialization and the full weights have been repeatedly deleted/replaced, the authenticity of the release is in question.

Reproducible evidence

The script below is self-contained. It uses only the Python standard library. It downloads public metadata and adapter_model.safetensors, parses safetensors directly, checks the model shard index against the repo tree, and computes exact zero counts/statistics for lora_A and lora_B.

Running it gives the following key result:

Safetensors summary
  tensor_count: 382
  dtype_count: {'F32': 382}
  class_count: {'A': 191, 'B': 191}
  actual_lora_A_ranks: [16]
  total_adapter_params: 17338368

Aggregate lora_A stats
  tensors: 191
  nonzero_tensors: 191
  n: 11108352
  zero_pct: 3.729158025
  std: 0.009593138251
  absmean: 0.008220978376
  min: -0.021484375
  max: 0.021484375

Aggregate lora_B stats
  tensors: 191
  nonzero_tensors: 0
  n: 6230016
  zero: 6230016
  zero_pct: 100
  std: 0

Conclusion
  all_lora_B_weights_are_exactly_zero: True
  lora_delta_is_exactly_zero: true

Required clarification

Please provide a concrete answer to these points:

  1. Is the currently published adapter_model.safetensors supposed to be the trained adapter?
  2. If yes, why are all lora_B tensors exactly zero?
  3. If no, why is an untrained/no-op PEFT adapter published in the model repository?
  4. Which rank/alpha/dropout values are real: model card rank 64/alpha 128/dropout 0.05, adapter_config.json rank 16/alpha 32/dropout 0.1, or merge_info.json rank 8/alpha 16?
  5. Why does model.safetensors.index.json reference 47 shards while only 42 are currently present?
  6. Why were previous safetensors model shards repeatedly deleted/replaced in the commit history?
  7. Where are the training logs, eval artifacts, or checkpoint lineage proving the claimed SFT + GRPO model exists?

Until these points are resolved, this repository should not be treated as a credible trained model release.

Self-contained audit script

#!/usr/bin/env python3
"""
Audit Chunjiang-Intelligence/DeepSeek-v4-Fable LoRA adapter provenance.

This script is intentionally self contained: it uses only the Python standard
library, downloads public Hugging Face files, parses safetensors directly, and
prints the evidence that the published adapter is a PEFT-style fresh LoRA
initialization:

  - LoRA A is random-looking Kaiming-uniform scale.
  - LoRA B is exactly all zeros.
  - Therefore every LoRA delta, (alpha / r) * B @ A, is exactly zero.

Run:
  python3 deepseek_v4_fable_lora_audit.py
"""

from __future__ import annotations

import argparse
import json
import math
import os
import re
import struct
import sys
import urllib.error
import urllib.request
from collections import Counter, defaultdict
from pathlib import Path
from typing import Any, Dict, Iterable, Tuple


DEFAULT_REPO = "Chunjiang-Intelligence/DeepSeek-v4-Fable"
DEFAULT_CACHE = Path("/tmp/deepseek_v4_fable_lora_audit")


def urlopen_bytes(url: str, timeout: int = 60) -> bytes:
    req = urllib.request.Request(
        url,
        headers={"User-Agent": "deepseek-v4-fable-lora-audit/1.0"},
    )
    with urllib.request.urlopen(req, timeout=timeout) as response:
        return response.read()


def fetch_json(url: str) -> Any:
    return json.loads(urlopen_bytes(url).decode("utf-8"))


def download(url: str, dst: Path, expected_size: int | None = None) -> None:
    dst.parent.mkdir(parents=True, exist_ok=True)
    if dst.exists() and (expected_size is None or dst.stat().st_size == expected_size):
        return

    tmp = dst.with_suffix(dst.suffix + ".tmp")
    req = urllib.request.Request(
        url,
        headers={"User-Agent": "deepseek-v4-fable-lora-audit/1.0"},
    )
    with urllib.request.urlopen(req, timeout=120) as response, tmp.open("wb") as out:
        total = int(response.headers.get("content-length") or 0)
        got = 0
        while True:
            chunk = response.read(1024 * 1024)
            if not chunk:
                break
            out.write(chunk)
            got += len(chunk)
            if total:
                print(f"\rdownloading adapter: {got / total:6.1%}", end="", file=sys.stderr)
        if total:
            print(file=sys.stderr)
    if expected_size is not None and tmp.stat().st_size != expected_size:
        raise RuntimeError(f"downloaded size mismatch: got {tmp.stat().st_size}, expected {expected_size}")
    tmp.replace(dst)


def parse_safetensors_header(path: Path) -> Tuple[int, Dict[str, Any]]:
    with path.open("rb") as f:
        header_len = struct.unpack("<Q", f.read(8))[0]
        header = json.loads(f.read(header_len))
    return header_len, header


def bf16_to_f32(bits: int) -> float:
    return struct.unpack("<f", struct.pack("<I", bits << 16))[0]


def iter_values(data: bytes, dtype: str) -> Iterable[float]:
    if dtype == "F32":
        for (value,) in struct.iter_unpack("<f", data):
            yield float(value)
    elif dtype == "F16":
        for (value,) in struct.iter_unpack("<e", data):
            yield float(value)
    elif dtype == "BF16":
        for (bits,) in struct.iter_unpack("<H", data):
            yield bf16_to_f32(bits)
    else:
        raise ValueError(f"unsupported dtype for numeric stats: {dtype}")


def tensor_stats(path: Path, payload_start: int, info: Dict[str, Any]) -> Dict[str, float | int]:
    start, end = info["data_offsets"]
    dtype = info["dtype"]
    with path.open("rb") as f:
        f.seek(payload_start + start)
        data = f.read(end - start)

    n = 0
    zeros = 0
    total = 0.0
    total_sq = 0.0
    total_abs = 0.0
    min_v = math.inf
    max_v = -math.inf
    for x in iter_values(data, dtype):
        n += 1
        if x == 0.0:
            zeros += 1
        total += x
        total_sq += x * x
        total_abs += abs(x)
        if x < min_v:
            min_v = x
        if x > max_v:
            max_v = x

    mean = total / n if n else 0.0
    variance = max(0.0, total_sq / n - mean * mean) if n else 0.0
    return {
        "n": n,
        "zero": zeros,
        "zero_pct": 100.0 * zeros / n if n else 0.0,
        "mean": mean,
        "std": math.sqrt(variance),
        "absmean": total_abs / n if n else 0.0,
        "min": min_v if n else 0.0,
        "max": max_v if n else 0.0,
    }


def combine_stats(stats: Iterable[Dict[str, float | int]]) -> Dict[str, float | int]:
    out = {
        "tensors": 0,
        "nonzero_tensors": 0,
        "n": 0,
        "zero": 0,
        "sum": 0.0,
        "sumsq": 0.0,
        "abssum": 0.0,
        "min": math.inf,
        "max": -math.inf,
    }
    for st in stats:
        n = int(st["n"])
        mean = float(st["mean"])
        std = float(st["std"])
        out["tensors"] += 1
        out["nonzero_tensors"] += 0 if int(st["zero"]) == n else 1
        out["n"] += n
        out["zero"] += int(st["zero"])
        out["sum"] += mean * n
        out["sumsq"] += (std * std + mean * mean) * n
        out["abssum"] += float(st["absmean"]) * n
        out["min"] = min(float(out["min"]), float(st["min"]))
        out["max"] = max(float(out["max"]), float(st["max"]))

    n = int(out["n"])
    mean = float(out["sum"]) / n if n else 0.0
    variance = max(0.0, float(out["sumsq"]) / n - mean * mean) if n else 0.0
    return {
        "tensors": out["tensors"],
        "nonzero_tensors": out["nonzero_tensors"],
        "n": n,
        "zero": out["zero"],
        "zero_pct": 100.0 * int(out["zero"]) / n if n else 0.0,
        "mean": mean,
        "std": math.sqrt(variance),
        "absmean": float(out["abssum"]) / n if n else 0.0,
        "min": out["min"] if n else 0.0,
        "max": out["max"] if n else 0.0,
    }


def fmt(x: Any) -> str:
    if isinstance(x, float):
        return f"{x:.10g}"
    return str(x)


def print_dict(title: str, d: Dict[str, Any]) -> None:
    print(f"\n{title}")
    for key, value in d.items():
        print(f"  {key}: {fmt(value)}")


def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("--repo", default=DEFAULT_REPO)
    parser.add_argument("--cache-dir", type=Path, default=DEFAULT_CACHE)
    parser.add_argument("--no-download", action="store_true", help="Use an existing cached adapter file.")
    args = parser.parse_args()

    repo = args.repo
    api_base = f"https://huggingface.co/api/models/{repo}"
    raw_base = f"https://huggingface.co/{repo}/resolve/main"

    print(f"Repository: {repo}")
    model_info = fetch_json(api_base)
    tree = fetch_json(f"{api_base}/tree/main?recursive=true&expand=true")
    by_path = {item["path"]: item for item in tree}

    adapter_config = fetch_json(f"{raw_base}/adapter_config.json")
    merge_info = fetch_json(f"{raw_base}/merge_info.json")
    model_index = fetch_json(f"{raw_base}/model.safetensors.index.json")
    readme = urlopen_bytes(f"{raw_base}/README.md").decode("utf-8", errors="replace")

    adapter_size = int(by_path["adapter_model.safetensors"]["size"])
    adapter_path = args.cache_dir / f"{repo.replace('/', '__')}__adapter_model.safetensors"
    if not args.no_download:
        download(f"{raw_base}/adapter_model.safetensors", adapter_path, adapter_size)
    if not adapter_path.exists():
        raise FileNotFoundError(adapter_path)

    model_shards_present = sorted(
        path for path in by_path if re.fullmatch(r"model-\d{5}-of-\d{5}\.safetensors", path)
    )
    model_shards_referenced = sorted(set(model_index.get("weight_map", {}).values()))
    missing_referenced = sorted(set(model_shards_referenced) - set(model_shards_present))

    readme_training_bits = {
        "mentions_rank_64": bool(re.search(r"rank\s+64", readme, re.I)),
        "mentions_alpha_128": bool(re.search(r"(alpha|α)\s+128", readme, re.I)),
        "mentions_dropout_0_05": "dropout 0.05" in readme,
        "mentions_trainable_0_94B": "0.94B" in readme,
        "mentions_BF16": "bf16" in readme.lower(),
        "mentions_GRPO": "GRPO" in readme,
    }

    print_dict(
        "Hugging Face metadata",
        {
            "sha": model_info.get("sha"),
            "lastModified": model_info.get("lastModified"),
            "adapter_size_bytes": adapter_size,
            "full_model_shards_present": len(model_shards_present),
            "full_model_shards_referenced_by_index": len(model_shards_referenced),
            "index_total_size_bytes": model_index.get("metadata", {}).get("total_size"),
            "missing_referenced_shards": ", ".join(missing_referenced) or "none",
        },
    )

    print_dict(
        "Config mismatch",
        {
            "adapter_config.r": adapter_config.get("r"),
            "adapter_config.lora_alpha": adapter_config.get("lora_alpha"),
            "adapter_config.lora_dropout": adapter_config.get("lora_dropout"),
            "adapter_config.init_lora_weights": adapter_config.get("init_lora_weights"),
            "adapter_config.peft_version": adapter_config.get("peft_version"),
            "merge_info.lora_r": merge_info.get("lora_r"),
            "merge_info.lora_alpha": merge_info.get("lora_alpha"),
            "merge_info.num_shards": merge_info.get("num_shards"),
            **readme_training_bits,
        },
    )

    header_len, header = parse_safetensors_header(adapter_path)
    metadata = header.pop("__metadata__", {})
    payload_start = 8 + header_len
    dtype_count = Counter(info["dtype"] for info in header.values())
    class_count = Counter(
        "A" if "lora_A" in name else "B" if "lora_B" in name else "other" for name in header
    )
    ranks = sorted(
        set(info["shape"][0] for name, info in header.items() if "lora_A" in name and len(info["shape"]) == 2)
    )
    shape_count = Counter(
        (("A" if "lora_A" in name else "B"), tuple(info["shape"])) for name, info in header.items()
    )

    a_stats = []
    b_stats = []
    examples = []
    for name, info in header.items():
        st = tensor_stats(adapter_path, payload_start, info)
        if "lora_A" in name:
            a_stats.append(st)
        elif "lora_B" in name:
            b_stats.append(st)
        if len(examples) < 8:
            examples.append((name, info["shape"], st))

    a_combined = combine_stats(a_stats)
    b_combined = combine_stats(b_stats)

    total_params = sum(math.prod(info["shape"]) for info in header.values())
    print_dict(
        "Safetensors summary",
        {
            "file_size_bytes": adapter_path.stat().st_size,
            "metadata": metadata,
            "tensor_count": len(header),
            "dtype_count": dict(dtype_count),
            "class_count": dict(class_count),
            "actual_lora_A_ranks": ranks,
            "total_adapter_params": total_params,
        },
    )

    print("\nShape counts")
    for (kind, shape), count in shape_count.most_common():
        print(f"  {kind} {shape}: {count}")

    print_dict("Aggregate lora_A stats", a_combined)
    print_dict("Aggregate lora_B stats", b_combined)

    print("\nFirst tensor examples")
    for name, shape, st in examples:
        compact = {k: st[k] for k in ("n", "zero_pct", "mean", "std", "absmean", "min", "max")}
        print(f"  {name} shape={shape} stats={{{', '.join(f'{k}: {fmt(v)}' for k, v in compact.items())}}}")

    print("\nKaiming-uniform sanity check for LoRA A")
    for fan_in in sorted({info["shape"][1] for name, info in header.items() if "lora_A" in name}):
        bound = 1.0 / math.sqrt(fan_in)
        expected_std = bound / math.sqrt(3.0)
        print(f"  fan_in={fan_in}: default bound +/-{bound:.10g}, expected std {expected_std:.10g}")

    all_b_zero = int(b_combined["zero"]) == int(b_combined["n"])
    print("\nConclusion")
    print(f"  all_lora_B_weights_are_exactly_zero: {all_b_zero}")
    print("  lora_delta_is_exactly_zero: true" if all_b_zero else "  lora_delta_is_exactly_zero: false")
    print(
        "  interpretation: this adapter is consistent with PEFT default LoRA initialization "
        "(random Kaiming lora_A, zero lora_B), not with a trained non-zero LoRA adapter."
    )
    return 0 if all_b_zero else 2


if __name__ == "__main__":
    raise SystemExit(main())

Sources checked

Sign up or log in to comment