본문으로 건너뛰기
Skillpedia
머신러닝48k · #5180

mathguard

하는 일

이 도구는 특히 대량의 데이터를 다룰 때 복잡한 계산 문제를 풀기 위한 고급 수학 방법을 고르도록 돕습니다. 기존 방법보다 더 효율적인 대안을 제안하며, 약간의 오차를 감수해야 할 수도 있습니다.

사용하는 경우

  • ✓수백만 개의 데이터 포인트에서 비슷한 항목을 빠르게 찾아야 할 때.
  • ✓신호나 이미지를 처리하며 빠른 계산이 필요할 때.
  • ✓일반 알고리즘도 이미 빠르지만 더 나은 해결책이 필요하고 작은 오차를 감수할 수 있을 때.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mathguard/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mathguard/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“1,000만 개의 이미지 데이터셋에서 중복을 찾아야 합니다. 거짓 양성은 어느 정도 허용할 수 있습니다. 어떤 수학 기법을 쓸 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 문제를 대용량 데이터에 더 효율적인 것으로 알려진 수학 기법들과 비교합니다. 정확한 해답이 필요한지, 아니면 알려진 오차가 있는 근사값이 허용되는지 확인합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

mathguard — Math-Heavy Optimization for AI Code

lemmaly makes you pick the right classical algorithm. mathguard kicks in when the classical algorithm is already optimal but mathematics gives a better bound — usually by accepting bounded approximation, exploiting structure, or moving to a smarter algebraic space.

The model knows these techniques. It almost never proposes them spontaneously. mathguard fixes that.

Violating the letter of these rules is violating the spirit of the skill. A Bloom filter where the caller assumed exact answers is a production incident, not an optimization.

When to Use This Skill

Use mathguard when:

  • Working with large-scale data (n ≥ 10⁶): similarity search, deduplication, top-K / heavy-hitters, streaming analytics, cardinality estimation, embeddings, recommender systems.
  • Doing signal/image processing, polynomial or big-integer arithmetic, convolution, graph distance, computational geometry, randomized algorithms.
  • The classical O(n log n) is already the floor and you need an asymptotic win (Bloom filter, HyperLogLog, Count-Min Sketch, MinHash/LSH, FFT/NTT, Johnson-Lindenstrauss projection, sweep line, kd-tree/BVH, fast exponentiation, monoid parallel reduction, amortized potential method).
  • Loaded after lemmaly has confirmed the classical answer is not enough.

Do not use mathguard when:

  • The caller needs exact answers (auth, billing, dedup-for-correctness, primary keys).
  • n is small (n < 10⁴) and the path is not hot.
  • The bottleneck is I/O, not CPU/memory.

The Iron Law

NO APPROXIMATE STRUCTURE WITHOUT WRITTEN ε/δ AND EXPLICIT CALLER ACCEPTANCE

Probabilistic data structures (Bloom, HyperLogLog, Count-Min, MinHash/LSH, t-digest), randomized projections (JL), and lossy transforms (floating FFT) all change the answer's meaning. Before proposing one:

  1. Write the error parameter the caller will see (false-positive rate, relative error, distortion bound).
  2. Identify the caller and state, in one sentence, that they tolerate this kind of wrong answer.
  3. If you cannot identify the caller, or they need exact (auth checks, billing, dedup keys, deduplication for correctness, anything that flows into a primary key), DO NOT propose the approximate structure. Keep classical, or escalate to a sharded/streaming exact design.

This rule has saved more incidents than any other in this skill. Do not soften it.

Non-negotiable rules

  1. Declare exact vs approximate up front. Before suggesting a math-level technique, state:

    • mode: exact or mode: approximate
    • If approximate: the error parameter (ε, δ, false-positive rate) and a sentence on whether the caller can tolerate it.
    • If the caller needs exact and there is no exact win, say so and stop — do not silently degrade to approximate.
  2. Cite the technique by name. Never describe a probabilistic or numerical trick in vague terms. Name it: Bloom filter, HyperLogLog, Count-Min Sketch, MinHash + LSH, Johnson–Lindenstrauss projection, FFT, NTT, fast exponentiation, Karatsuba, Strassen, sweep line, kd-tree, BVH, union-find with path compression, Floyd's cycle detection, Boyer-Moore majority, reservoir sampling, Knuth shuffle, Aho-Corasick, suffix automaton, segment tree with lazy propagation, Fenwick tree, monoid scan / parallel prefix. A named technique is auditable; "a smart approximation" is not.

  3. State the trade you are making. Every math-level optimization buys something at a cost. In one line:

    • Buys: space, time, wall-clock, parallelism.
    • Costs: accuracy ε=?, code complexity, dependency, non-determinism, numerical stability.
    • If the cost is invisible to the caller, write "callers see no change".
  4. Justify the asymptotic win. Do not propose a math technique without a one-line bound argument:

    • "HyperLogLog: count uniques in O(log log n) bits at standard error 1.04/√m."
    • "FFT: polynomial multiplication O(n log n) vs schoolbook O(n²)."
    • "JL projection: preserves pairwise distances within (1±ε) using O(log n / ε²) dimensions."
    • "Sweep line: rectangle overlap from O(n²) pair checks to O(n log n) events." No bound, no proposal.
  5. Forbid math cargo-culting. Do not introduce these techniques when:

    • n is small enough that a linear scan finishes in microseconds (n < ~10⁴ unless it is a hot path).

…

자주 묻는 질문

「알려진 오차를 가진 근사값」은 무엇을 뜻하나요?

답이 100% 정확하지 않을 수 있지만, 오차가 작고 예측 가능하다는 뜻입니다(예: 틀릴 확률이 1%). 이렇게 하면 계산을 훨씬 빠르게 할 수 있습니다.

이 도구를 언제 쓰지 말아야 하나요?

금융 거래처럼 정확도가 매우 중요할 때, 또는 데이터가 적어(1만 개 미만) 간단한 방법으로 이미 잘 작동할 때는 사용하지 마세요.

어떤 기법을 제안할 수 있나요?

문제에 따라 Bloom Filter, HyperLogLog, Count-Min Sketch, MinHash, FFT(고속 푸리에 변환) 등을 제안할 수 있습니다.

상세 정보

작성자의 원본 설명

Math-heavy escalation for n >= 10^6 — Bloom, HyperLogLog, Count-Min, MinHash/LSH, FFT, JL projection, sweep line. Use when classical O(n log n) is the floor and approximate or math wins.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#5180
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬