Index
2026-05-12 — Analysis

ApiMem Hybrid BinFill 4-frame + Pro 비용 분석 종합 정리

memer · robomme_policy_learning · BinFill 50ep hybrid sweep (260501–260511)

TL;DR

22%
4f Hybrid SR
12%
1f Hybrid SR
64%
LoRA Baseline
$0.32
Pro 4f Cost/ep
2
NEW vs LoRA (ep)

1 배경 / 목적

260501–260504의 8-run ApiMem-only BinFill sweep에서 모든 설정(flash-lite/pro × 1-call/2-step)이 SR 4-17% noise 범위에서 벗어나지 못했다. MemER LoRA standalone SR 64%와 ~56pp 격차. 8-run 분석에서 남은 가설:

이 라운드(260506–260511)는 가설 (c)(d)를 multi-frame context로, 그리고 Gemini Pro의 추론 능력 향상 효과를 검증하는 실험이다.

2 작업 내용

Hybrid πHL 아키텍처 (기존 1f, 260506)

HybridApiMemLoRACoordPredictor: 매 K=48 step API tick마다 ApiMem + MemER LoRA 둘 다 inference. verb+object Jaccard ≥ 0.5 일치 시 API subgoal의 좌표를 LoRA 좌표로 swap. mismatch 시 API as-is. Per-call decision을 ep{N}_hybrid_log.jsonl로 logging.

Multi-frame Context 추가 (260507, 가설 d 검증)

LoRA는 매 call 8 frame + keyframe을 받지만 ApiMem은 1 frame만 → mt count tracking 구조적 불가. ApiMemModel.get_subgoal(frames)를 list 받도록 변경: detection은 latest 1 frame, reasoning은 N frame 균등 subsample (oldest→newest). CLI flag: --api_mem_frames_per_call <N>.

Pro × 4f 비용 측정 (260510)

api.pyprompt_tokens / completion_tokens / total_tokens logging patch. 3ep smoke로 실측. Gemini 2.5-pro 가격 기준 비용 산출.

3 결과

BinFill 전체 run SR 종합 (모든 보존된 run)

Run 태그설명DoneSuccSRNEW vs LoRA
BinFill_3317_antiparrotflash-lite, 1-frame5036.0%0
BinFill_propro, 1-frame5024.0%1
BinFill_rescaledflash-lite, rescale fix5048.0%0
BinFill_2stepflash-lite, 2-step det+rea4836.2%0
BinFill_flashlite_loracoordHYBRID flash-lite, 1f50612.0%0
BinFill_flashlite_lc_4fHYBRID flash-lite, 4f ★501122.0%2
BinFill_pro_4f (cancelled)HYBRID pro, 4f (n=7)7228.6%*0
(LoRA standalone)MemER LoRA full503264.0%

*n=7, 통계적으로 불충분. 취소 근거: flash-lite 4f 22%보다 약함 + 23x 비용.

Hybrid Action Stats: 1f vs 4f (50ep)

Action1f Hybrid4f HybridΔ
swapped (verb 일치 → coord LoRA)46.9%56.5%+9.6pp
verb_mismatch (API as-is)53.1%43.5%−9.6pp
no_coord0%0%0
multi-frame으로 ApiMem의 verb가 LoRA와 더 잘 sync됨. mt progression 추적이 더 정확해져 같은 phase 내에 있을 확률 ↑ → swap rate 46.9→56.5%.

4f vs 1f Hybrid: Episode Set 분석

NEW vs 1f (9 ep): ep[1, 14, 16, 18, 25, 28, 31, 41, 45] → multi-frame으로 풀린 새 episode LOST vs 1f (4 ep): ep[4, 5, 6, 44] → 1f에서 풀렸는데 4f에서 실패 (easy 1-cube → multi-frame으로 over-think 가설) NEW vs LoRA (2 ep): ep[14, 18] → 처음으로 LoRA도 못 푸는 ep를 hybrid가 해결. 1f hybrid에서는 NEW vs LoRA = 0

Pro × 4f 비용 실측 (3ep smoke)

Call 타입callsInput tokensOutput tokens (thinking 포함)
Detection2617,78462,643
Reasoning2760,86222,396
Total (3ep)5378,64685,039
비용 계산 (Direct Gemini 2.5-pro 가격) Input $1.25/M token → $0.10 (3ep) Output $10.00/M token → $0.85 (3ep) ───────────────────────────────────── 3-ep total: $0.95 / per-ep: $0.32 50-ep 외삽: ~$16 flash-lite 동일 사용량: ~$0.04 (3ep), ~$0.70 (50ep) → pro가 flash-lite 대비 23x 비용 비용의 ~75%: detection thinking tokens pro가 단순 JSON detection에도 thinking으로 max_tokens≈4096 소진 ep1/ep2 detection 평균 2,700-3,000 output tokens/call
Pro 4f 조기 취소 (7/50): 7ep 결과 (SR ~28.6%, n=7 insufficient) + 추세상 flash-lite 4f (22%) 못 넘을 가능성 ↑ + 23x 비용. 실용적 선택 아님.

4 Takeaway

가설별 결론

가설검증 결과기여도
(a) wording mismatchverb만 borrow해도 SR 안 오름부분 기여
(b) coord precision1f hybrid 12% - ApiMem-only 8% = +4ppminor
(c) timing/call_periodverb_mismatch 53%→44%, 일부 영향부분 기여
(d) mt count tracking1f→4f SR 12%→22% (+10pp), NEW vs LoRA 0→2가장 큰 기여

핵심 결론

multi-frame context가 ApiMem의 진짜 한계였다. Single-image zero-shot으로는 BinFill의 cube in/out progression을 verify할 수 없다. 4 frame으로 mt count tracking을 일부 회복했고, 처음으로 LoRA-fail-only인 ep를 hybrid가 해결하는 사례(ep14, 18)가 나왔다. 이는 ApiMem의 mt가 순수 LoRA보다 가치 있는 정보를 보태는 첫 번째 증거다.

그럼에도 LoRA 64%와 42pp 격차가 여전히 존재한다. Multi-frame으로도 in-domain LoRA를 따라잡지 못한다. ApiMem의 진짜 가치는 OOD 또는 long-horizon task에서 찾아야 한다. BinFill은 LoRA가 강한 task로, ApiMem 우위를 보이기 어려운 구조.

Pro는 BinFill에서 cost-performance 매우 나쁘다. 비용의 75%가 단순 JSON detection의 thinking tokens에서 나온다. Flash-lite 4f 22% vs Pro 4f (n=7 불충분, 추세 약함), 23x 비용 → 실용적 선택 아님.

5 Next Steps

즉시 시도 가능: N=8f flash-lite

4f → 8f로 늘리면 더 좋아지나? 비용은 거의 안 늘어난다 (flash-lite 50ep ~$1.4). verb_mismatch가 4f에서 43.5%까지 내려갔고, 8f라면 더 줄어들어 SR 25%+ 가능성 있음. 단독 ablation으로 확인 가치 있음.

Mixed model (det=flash-lite, rea=pro)

Pro reasoning의 강점만 살리고 detection cost를 flash-lite로 줄임. 예상 비용 ~$3-4 (50ep). Detection thinking tokens 비용 75% 제거 효과. Pro의 reasoning이 실제로 더 나은지 격리 검증 가능.

LoRA가 약한 task로 이동 (우선 권장)

BinFill (LoRA 64%)은 ApiMem의 mt 강점을 검증하기 어려운 구조다. 다음 후보:

  • PatternLock (LoRA 16%) — 4-frame hybrid 인프라 그대로 적용 가능
  • StopCube (LoRA 4%), RouteStick (LoRA 10%), InsertPeg (LoRA 4%) — long-horizon counting/sequencing 강점 발휘 가능

이 task들에서 hybrid 4f가 LoRA baseline을 크게 넘으면 ApiMem mt의 실용 가치 확증.