INNER CODE UNIT · Python

budget

FareedKhan-dev/kimi-k3-in-c · tools/cmp_logits.py:88

    budget = 1.2e-7 * np.sqrt(hidden) * 50

    ca, ra = int(np.argmax(c)), int(np.argmax(r))
    # Rank correlation on the top of the distribution is the property that actually
    # decides generated text, so report it separately from the raw elementwise diff.
    ctop = set(np.argsort(-c)[:10].tolist())
    rtop = set(np.argsort(-r)[:10].tolist())

    print("vocab                 : %d" % c.size)
    print("C argmax              : %d  (logit %.6f)" % (ca, c[ca]))
    print("reference argmax      : %d  (logit %.6f)" % (ra, r[ra]))
    print("top-10 overlap        : %d/10" % len(ctop & rtop))
    print("max |diff|            : %.6e" % float(d.max()))
    print("relative to max|ref|  : %.6e   (budget %.1e)" % (rel, budget))
    print("mean |diff|           : %.6e" % float(d.mean()))
    print("correlation           : %.9f"
          % float(np.corrcoef(c.astype(np.float64), r.astype(np.float64))[0, 1]))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…