Look Where It Matters: High-Resolution Crops Retrieval for Efficient VLMs
Vision-language models (VLMs) typically process images at a native high-resolution, forcing a trade-off between accuracy and computational efficiency: high-resolution inputs capture fine details but incur significant computational costs, while low-re…
Authors: Nimrod Shabtay, Moshe Kimhi, Artem Spector
L oo k W h e r e I t M a t t e r s : H i g h - R e s o l u t i o n C r o p s R e t r i e v a l f o r E f f i c i e n t V L M s Ni m rod Sh a bt a y 1 , 2 ⋆ , Mo sh e Ki mh i 1 , 3 ⋆ , Ar te m Spe ct o r 1 , Si v an H ar a y 1 , Eh u d Ri vl i n 3 , Ch ai m Ba sk i n 4 , Raja Gi ry es 2 , an d El i Sc h w ar t z 1 1 IB M Re se ar c h 2 T e l- A v iv U ni v ers it y 3 T e c hn i on 4 Be n-G uri on U ni v e rs it y A bs t ra c t. Vi sio n-l ang uag e mod e ls (V LMs ) t yp ic al ly p roc es s im age s a t a na tiv e h ig h- re sol uti on, f or c in g a tra de- off be t w ee n ac cu ra cy a nd c om pu ta- ti ona l ef fic ien cy: h i gh -r es olu tio n in put s ca ptu re fi n e de ta il s bu t in cur s i gn if i ca n t co mpu tat ion al co s ts , wh il e lo w-r eso lut ion i n pu ts a dv o c at e fo r ef f ic ie n cy , t he y pot e n ti all y mi ss c ri tic al vi su a l inf orm ati on, l ik e sm al l te x t. W e pr ese n t A w aR e s, a sp at ial -on -de man d fr a me w ork t ha t re s ol v es th is a cc u ra cy – ef fi c ie nc y tr ad e-o ff b y ope r at in g on a l o w- res o lu ti o n gl ob al v ie w an d us in g too l -c al li ng to r et ri ev e on ly hi gh- res olu tio n seg men ts ne ede d fo r a gi v en qu ery . W e co ns tr u ct s upe r- vi sed d ata a uto mat ica lly : a jud ge co mpa res lo w- vs . hig h-r eso lut ion an s w er s to la bel wh et her cr op pin g is ne ed ed, an d an or ac l e gr ou nd ing mod el loc al iz es th e ev ide nce fo r th e co rre ct an s w er , whi c h w e ma p to a di sc re t e cr op se t to fo rm m u lt i- t ur n too l- us e tr a je cto rie s. W e tr ai n ou r fr a me w ork wi th co ld -st art SF T fol lo w ed b y mu lti -tu rn GRP O wit h a co mpo si te re wa rd tha t com bin es se man tic an sw er co rr ec t ne ss wi t h ex pl i ci t cr op- cos t pena lti es. P roje ct P a ge : ht tp s:/ /n im ro d sh ab t ay .g ith ub. io /A wa R es / T h e te m p e r a tu r e i s 5 ° C ✓ < t o o l _ r e sp o n se >: H i g h - R e s C r o p G E T _ C R O PS : [ ' c e n te r ' ] W h a t ’ s t h e t e m p e r a t u r e ? L o w - R e s I m a g e U F ig . 1 : A w aR es o v er v ie w. Le ft: Giv en a lo w- re s ol ut io n im ag e, A w aR es use s too l- ca l li ng to re que st on l y th e hi gh - re so l ut io n cr ops n e ed ed t o an sw er th e qu ery . Ri g h t: A ccu rac y v s. r et ai ned vi sua l t ok ens acr oss si x ben c hm ar ks . A w aR es per fo rm s si mi l ar ly to na ti v e hi gh - re so lu tio n (8 0.3 %) whi le us in g on l y 36 % of the v is ua l to k en s . ⋆ Eq ual co n tr ib ut ion . 2 N. Sh abt a y, M. Ki mh i et al . 1 I n t r odu ct io n Vi si on – la ng ua ge mod e ls (V L Ms ) in cr ea si ng l y re l y on hi gh -r e so lu ti on vi s ua l in pu t s to so lv e de ta il -s e ns it iv e ta sk s su c h as doc um en t qu e st i on an sw er in g , c h ar t un de rs ta nd in g , an d un d er s ta nd in g se ma n ti cs a nd t ex t in d en se n at ur al i ma ge s. Ho w ev er , hi g h re so l ut io n is ex pe ns iv e: t he n um b e r of vi su al to k en s gr o ws ra pi d ly wi th im ag e r es o lu ti on , ma ki ng hi gh -r e so lu ti on in fe re nc e a majo r bot tl e ne c k in pr ac ti ce . Ex is ti n g a pp ro ac he s t o r ed uc e t hi s c o st la rg el y fa ll i n to t w o c a mp s . F i rs t , to k en p ru ni ng me th ods se le ct iv el y di sc ar d vi su a l to k en s to re d uc e co m pu ta ti on [4 , 26 , 27 , 3 0, 32 ]. Wh il e ef fe ct i v e i n p ri nc ip le , th e y of te n i n t rod uc e ir re gu la r t ok en p a tt er ns a nd dy na mi c se qu en c e le ng th s t ha t ca n b e di ff ic ul t to tr an sl at e in to en d- t o- en d se rv in g spe ed up s in c om mo n in fe re n ce s ta c ks , su c h a s vL L M [1 3] , wh e re e ff i ci en cy is t ie d to p re d ic t ab le s eq ue nc e le n gt h. Se co nd , r es ol ut io n es c al a ti o n me th ods [ 12 , 19 ] le ar n wh e n to re qu es t a hi gh er -r es ol ut i on vi ew , b ut t y pi ca ll y t re a t t he de ci s io n a s b i na r y: if m or e d et ai ls a re n e ed e d, th e e n t ir e h i gh - re so lu t io n im a ge is re t ri e v e d, w as t in g co m pu t at io n o n re gi o ns ir re le v an t to th e qu es ti on . A k ey ob s er v at io n is th at th e d e ma n d f or hi gh fi de li t y i s u su al ly s p at ia l l y sp ar se , a s ca n be se en in F ig . 3. Ma n y qu es ti o ns re qu ir e fi ne d et ai l in on ly a sm a ll por t io n of th e im ag e : a si n gl e v al ue on a c h ar t ax i s, a s pec if i c ce ll in a ta b le , or a t in y obje ct in th e c or ne r o f an im ag e. In ca s es wh er e lo w re so lu ti o n im ag e do no t pos es th e fi ne -g ra in e d in fo rm at i on , re tr ie v in g th e f ul l i m ag e at na ti v e h ig h- r es ol ut io n is un ne ce ss a ri ly e xpe ns iv e. W e a dv oca te th at an sw er in g th e q ue st io n of wh er e t o loo k ma tt er s as m uc h as wh e th er to look . W e pr opo se VL M th at is sp at ia l ly a w ar e to re so lu ti on (a bb r ev ia te d A w aR e s) , a fr am ew or k th a t ex pl oi ts th is sp a ti a l sp ar si t y vi a a si m pl e too l- c al li ng in te r fa ce th at ta rg et s hi g h- re so lu t io n cr o p ac qu i si ti o n . A w aR es pr oce s se s a lo w -r es ol ut i on gl ob a l vi ew b y de fa ul t, a nd wh en ad di ti on al de ta il is re q ui r ed , it in v ok es a t ool -c al l t ha t re qu es t s on l y spe ci fi c hi g h- r es ol ut io n su b- re gi on s , an d t he n a ns w er s co nd it i on ed on bot h. Th is m ul ti - tu rn st r uc tu re is na tu ra ll y co mp at ib le wi th KV -c ac hi ng : co mp u ta t io n fr om th e in it i al lo w- re so l ut io n tu rn is re us ed an d e xt en de d in th e cr op tu rn wi th ou t ar c hi t ec t ur al c ha n ge s , ma ki ng A w aR e s pr ac ti c al fo r de pl o ym e n t . W e tr ai n A w aR es to le ar n a si ng l e c o up le d- de c is i on p ol i cy (C D P) th at j oi n tl y de ci de s (i ) wh e th e r ad di ti on a l re s ol ut io n is ne ed ed an d (i i) wh er e to ac qu ir e it b y se le ct in g a su bs et of cr o ps . Cr uc ia ll y , th es e de ci si on s ar e fu se d i n t o th e mode l’ s fi r st -t ur n ac t io n : ei th er an sw er di re ct ly , or em it a st ru ctu re d cr op re qu est th at si m ul t an eo us ly si g na l s es ca la t io n an d spe ci fi es th e ta rg et re gi on s. F or th e co ld -s ta rt p ha se , w e co n st r uc t th e supe rv is io n au to m at ic al ly , w it ho ut ma n u al sp at ia l an n ot at io ns , b y (i ) id e n tif yi ng ex am p le s wh e re lo w r es ol ut io n is in su f fi ci en t us in g an LL M a s a Ju dg e ( La aJ ) th at co mp a re s lo w- v s. hi gh - re s ol ut io n mod el ou tp ut s, an d (i i) loc al i zi ng th e ev i de nc e fo r th e co rr e ct an s w e r us i ng an or a cl e gr ou n di ng mode l to pr odu ce ta r ge t cr op s . W e ev al ua t e A w aR es on si x ben c hm ar k s sp an ni n g doc um en t un de r st an di ng a nd ge ne ra l vi su al QA . A c ro ss th e se ta sk s , A w aR es al mo s t ma tc he s fu ll hi gh -r es o lu ti on per fo rm an ce on a v er a ge (8 0. 3% vs . 8 0. 4 6% ) wh i le us in g o nl y 36 % o f th e pi x el s/ to k en s, su bs ta n ti al ly re d uc i ng i nf er en ce co st . On Ch ar tQ A, Doc V QA an d O CR Be nc h, A w aRe s ev en sl ig h tl y im p ro v es o v er fu l l- r es ol ut io n ba se li ne s w hi l e re ma in in g si g ni f ic an tl y mo re ef fi ci e n t . A w aR es 3 Ou r Co n tr ib u ti o ns ar e li st ed as fo l lo ws : – W e in tr odu c e a s pa ti al -o n- de m an d in f er en ce fr am ew or k f or VL Ms th at re qu es ts on ly ta rg et ed hi g h- re so lu t io n cr o ps th ro u gh tool -c al l in g, en ab li ng sy st e m- f ri en dl y m ul ti - tu r n KV -c ac he re us e. – W e pr o pos e an au to ma t ic da ta cu ra ti o n pi pel in e th a t pr odu ce s m ul ti -t ur n too l -u se tr a je ct or ie s wi th ou t ma n ua l sp at ia l an no t at io ns . – W e re f in e cr op us a ge wi t h m ul ti -t ur n GR P O us in g an ex pl ic it ac cu ra cy –e f fi ci en cy obje c ti v e th at pen al i ze s un ne ce ss ar y cr op ac q ui si ti on wh il e di sc ou r ag in g mi ss ed cr o p re qu es t s wh en de ta i l is re qu i re d. 2 R e la te d W or k Se v er al st r at e gi es ha v e em er ge d to pr u ne , co m pr es s, or dy na mi ca l ly re du ce th e n um ber of vi su a l to k en s in Vi s io n La ng u ag e Mod el s. On e li ne of re se ar c h focu se s on dy na mi c to k en pr un in g. Me th o d s su c h as F as t V [4 ] , Ho lo V [3 2 ], Py ra mid Dr op [2 6] , Fi tP r un e [2 8] , T op V [8 ], Sp ar se VI LA [1 1 ], IV TP [7 ], LL aV ol ta [3 ], an d SA IN T [9 ] di sc ar d un i nf o rm at iv e to k en s wi th in th e LL M la y e rs ba se d on at te n ti o n sc or e s or le a rn e d cr it er ia . Al te r na t iv el y , Vi si on Zi p [2 7] , F as tV L M [2 2] , an d Sp ar se VL M [3 0] pr un e to k en s di re ct ly a ft er th e vi si o n en cod er . Wh i le e ff ec ti v e , pr un in g -b as ed ap pr oa c he s m us t co mm it to a fi xe d re te n ti on ra t io bef or e in fe re nc e, ap pl yi n g t he sa me to k en bu dg e t r eg ar dl es s o f s am pl e c o mp le xi t y . I n c on tr as t , o ur me th o d is f ul ly ad a pt i v e : it dy n am ic al ly d et e rm in es bot h wh et he r ad di t io na l de t ai l is n ee de d an d wh ic h sp at i al re gi on s to ac qu ir e, al lo wi ng si mpl e im ag es to be pr oce ss ed at mi ni m al co st wh il e al l oca ti ng m or e re so ur ce s on ly wh en th e q ue r y de ma nd s fi n e- gr ai ne d per ce pt io n. A se c on d li n e of w or k ex pl or es re so l ut i on se le ct io n. CA RE S [1 2] us e s an e xt er na l li gh t w ei g h t mod el to pr e di c t th e op ti m al in p ut re s ol ut io n bef o re th e VL M pr o c es se s th e im ag e, wh il e CR OP [6 ] id en ti fi es co n te x tu al re gi on s of i n t er es t vi a a n au xi l ia ry mod ul e. Th es e me th o d s re ly on ex te r na l co mpon en ts to ma k e re so lu ti on de ci si o ns , wh er ea s ou r ap pr oa c h en a bl es th e VL M it se lf to de t er mi ne wh en an d w he r e ad d it i on al de ta il is ne ed ed th ro ug h it s na ti v e ca pa bi li ti es , re qu ir i ng no au xi li a ry mod e ls . Re ce n t fr am ew or ks li k e Zoo mE y e [ 20 ] an d De epE y es [3 1] en ha nc e VL M per fo rm an ce th ro ug h dy na mi c z oom i ng an d hi gh -r es ol ut io n cr op pi ng . Ho w ev e r, th es e m et h ods pr io ri t iz e ac c ur ac y o v er ef fi ci en c y: Zoom Ey e p e rf or ms m ul ti p le in fe re nc e pa ss e s th ro u gh a hi er arc hi ca l im a ge tr ee , wh il e De ep Ey es a ppe nd s zoo me d cr op s to th e co n te xt , pr og re s- si v el y in cr ea s in g th e to k en co un t. In co n tr a st , ou r w or k em pl o ys cr o pp in g s pec if i ca l ly fo r ef fi ci e nc y— re qu e st in g on l y t he mi ni m al hi gh -r es ol u ti on re g io ns ne ed ed w h il e m ai n ta in in g a co mp a ct to k en bu dg et . Vi si on T hi nk [1 9 ] in tr odu ce d a re in fo rc em en t le ar ni ng ap pr oa c h wh er e t he mod el pr oce ss es a lo w- re so lu ti on i mag e an d e mi ts a too l ca ll t o r eq ue st a h i gh -r es ol ut io n v er si o n wh en ne ed ed . Wh il e ef fe c ti v e at d et e rm in in g re so lu t io n su ff i ci e nc y , Vi si on Th in k re tr ie v es th e en ti re hi gh -r es ol u ti on im ag e gl oba ll y wh en es ca l at i on i s tr ig g er ed . Ou r me th od goe s fu rt he r b y id e n t if y in g th e spe ci fi c re gi o ns th at ma tt er fo r an sw er in g th e qu e ry , re qu es t in g on ly ta r ge te d hi gh - re s ol ut io n su b -r e gi on s ra th er th an th e fu ll im a ge . T hi s sp at ia l -o n- de ma n d ap p ro ac h mi ni mi ze s to k en o v er h ea d wh il e p re se rv in g th e ac cu ra cy ben ef it s of hi gh -r es ol ut io n per ce p ti on ex ac t ly wh e re it ma tt e rs . 4 N. Sh abt a y, M. Ki mh i et al . 3 M e th od A w a Re s im pl em en ts sp at i al - on -d em an d per c ep t io n vi a a s im p le m ul ti -t u rn in te r ac ti on : th e mod el fi rs t ob se r v e s a lo w- re so l ut io n gl ob a l vi ew , an d on l y if ne e de d is su es a too l ca ll to re tr i ev e a se t of hi gh -r e so lu ti on cr op s (F i g. 1 ). W e fi rs t fo r ma l iz e th is in te ra ct io n pr ot oco l (§ 3. 1 ), th e n de s cr i be ho w w e au to ma t ic al ly cu ra t e su p e rv is io n fo r th e CD P , na me ly wh et h er ad d it i on al re so l ut io n is ne ed ed an d wh er e it ma tt er s (F i g. 2; §3 .2 ). Fi na ll y , w e tr ai n in t w o s ta ge s: (i ) a c ol d- st ar t s upe rv ise d fi ne -t un in g (S FT ) st ag e th at te ac he s th e too l pr ot oc ol an d yi el d s a s upe rv ise d r e fe r en c e p ol i cy π re f (§ 3. 3) ; an d (i i) m ul ti - tu r n GR PO in i ti al iz ed fr om π re f an d re g ul ar iz ed to w ar d it vi a a KL pen al t y (§ 3. 4) , ex pl i ci t ly op tim iz in g th e ac cu ra cy –e f fi ci en cy tr ade -o ff . 3 .1 P ro bl em se tu p Gi v en an im a ge –q ue st i on –a ns w e r t ri pl e ( I ,q,a ⋆ ) , th e mod e l i s f i rs t s ho wn a l o w- re so lu ti o n vi ew I lo w (o bt ai n ed b y do wn sa mp li ng I ) to g et h er wi th th e qu es ti on q . Th e mod e l th en c hoo se s bet w e en t w o ac ti on s : ( i) Di r ec t a ns w e r: Pr odu ce s an an s w e r ˆ a co nd i ti o ne d on ly on ( q,I lo w ) . ( ii ) Cr o p r eq ue st + an s w er : Em it s a too l cal l th at re qu e st s a s ub s et of cr op s fr om a pr e de fi ne d ca nd i da t e se t, C re q ⊆ C . Th e too l re t ur ns th e co r re spo n di n g hi gh - re so lu ti o n cr op im ag es { I hi gh c } c ∈ C re q , wh i c h ar e a ppe nd e d to t he di al o gu e co n te xt , an d t he mod el pr odu ce s th e fi na l an sw er ˆ a co nd i ti on ed on th e fu ll m ul ti - tu r n hi st or y . A fu se d co up le d- d ec is i on po li cy : W e p ar am et er i ze a s i ng le pol ic y o v er hi gh re so lu t io n re qu es t , an d loc al i ze d cr op se le ct i on : π θ ( C | q,I lo w ) , C ⊆ C , (1 ) wh er e C = ∅ c or re spo nd s to no to ol c all (a ns w er di re ct ly ) an d C = ∅ co r re s pon ds to e sc al at io n w it h lo c al iz at io n . Un de r th is v ie w, “ w he n to c r op ” is t he m ar g in a l ev en t 1 [ C = ∅ ] , wh il e “w h er e t o cr o p” is th e co nd it io na l di s tr ib ut io n o v er C gi v en C = ∅ . T he t w o ar e in he re n tl y co up le d: th e v al u e of es ca l at in g de pen ds on wh i ch r eg i on s wi ll b e re tr ie v ed , si nc e in ac cu ra t e loc al i za t io n ca n w as te co m pu t e wi th out im pro vi ng an sw er co rr ec tn es s . Th is in te rf ac e ta r ge t s ef fi ci en cy b y re st r ic ti ng hi g h- r es ol ut io n per ce p ti o n to a sm al l n u m- ber of s tr uc tu re d re g io n s, wh il e pr e se rv in g th e lo w- r es o lu ti on gl ob al co n t ex t th r ou gh ou t th e in te ra ct io n (S ee Fi g. 1 fo r a co n v er sa ti on ex a mp l e) . 3 .2 D at a c ur a ti on : au to m at ic s upe r vi si o n fo r cr op re qu es t s A k ey c ha l le ng e is to su pe rv is e t w o co up le d de ci si o ns : wh et he r th e l o w -r e so lu ti on vi ew is in su ff i ci en t, an d wh er e to cr op wh e n ad di ti on a l de ta il is ne ed ed . W e ge n er at e th is su per vi si on to in it i at e th e mod el to le ar n a re fe re nc e pol ic y π θ ref in a n au to ma ti c fa sh io n us in g th e th re e -s ta ge pi pel i ne (I ll us tr at ed in Fi g. 2) : S ta ge 1: r es ol ut io n- su ff ic i en cy la b el in g ( wh e n t o c r op ). F or ea c h ex am pl e ( I ,q,a ⋆ ) w e ut il iz e a ba s e VL M T on bot h the lo w- re so lu t io n an d fu ll -r e so lu ti on in pu ts : ˆ a lo w = T ( q,I lo w ) , ˆ a fu ll = T ( q,I ) . (2 ) Be ca us e ˆ a lo w an d ˆ a fu ll ma y di ff e r in fo rm th o ug h se ma n t ic al ly co rr ec t, d ir ec t st ri ng ma tc hi ng (e xa ct ma tc h) wi th a ⋆ is un re li ab le . In st e ad , w e us e an La aJ (L La MA -3 .3 - 70 B [5 ]) to c om p ar e b o th pr e di ct io ns to th e gr ou nd tr ut h a ⋆ . If it ju dg es ˆ a lo w as c or r ec t (o r ti es it w i th ˆ a fu ll ), w e la b e l t he ex a mp le as no cr op ne ed ed L R ; o t he r wi se w e la b e l i t a s H R . A w aR es 5 S ta ge 2: cr op ta r g et c on s tr u ct io n (w he r e to cr op ). F or ex am pl e s la bel ed H R , w e id e n ti fy th e re gi on th a t co n ta in s th e vi su a l ev id en ce ne ed ed to an s w e r ( q,a ⋆ ) . W e pr om p t an or ac l e gr ou nd i ng mode l G (n am el y , Qw en 3 -V L -A 23 5B -A 2 2B [1 ]) to loc a li ze th e ev i de n ce an d re tu rn a b o un di ng bo x b = ( x 1 ,y 1 ,x 2 ,y 2 ) in th e coo rd in at e sy s te m of th e or i gi na l i ma g e. W e th en ma p b to ou r d is c re te cr o p ca nd id at e se t C , wh ic h in cl ud es fo ur qu ad ra n ts , a ce n te r cr op , f ou r me r ge d ha l f- im ag e re gi o ns (t op /bo t to m /l ef t/ ri g h t ), an d a f ul l- im ag e . W e de f in e th e t ar ge t cr op su bs e t as C ⋆ = { c ∈ C | Io U( b, c ) ≥ τ } , (3 ) wh er e τ = 0 . 5 i s th e I oU t hr es ho ld . Fi g . 3 sh o ws a re pr es en ta ti v e ex am pl e , an d F ig . 5 ( le ft si de ) su mm ari ze s th e em pi ri ca l di s tr i bu ti on of se le ct ed cr op s in th e cu ra te d tr ai n in g se t . No Ye s Low - R e s I n s t ru c t i o n L L M J u d g e " I s L R e n o u g h ? ” S i n g l e T u rn C o n v e rs at i o n B a s e V L M L o w - R e s P re d i c t i o n GT H i g h - R e s P re d i c t i o n M u l t i T u rn C o n v e rs at i o n H i g h - R e s B a s e V L M Ora c l e P re d i c t c ro p F ig . 2 : Ov er vi ew of th e au to ma ti c s upe rv is i on pi pel in e. Ea c h sa mp l e i s p roc es se d at t w o res o lu ti o ns ; an LL M ju dg e de te r mi ne s re s ol ut io n su ffi c ie nc y b y co m pa ri n g pr ed ic t io ns to gr oun d tru th. Su ffi cie n t ca se s yi el d si n gl e- t ur n co n v er sa tio ns, wh ile in suf fic ien t cas es are ro ute d to an or a cl e fo r cr op loc al iz a ti on , prod uci ng m ult i-t urn tr ajec tor ies wi t h too l- ca lli ng. S ta ge 3: s up er vi se d to ol -u se t r aj e ct or ie s . Th e pr oce du re abo v e yi e ld s t w o t y pes of tr ai ni n g tr an sc ri pt s: D ir ec t- an s w er tr a j ec to ri es ( L R ) . Th e mod el ob se r v e s ( q,I lo w ) an d is su per vi se d to ou tp ut a ⋆ in a si ng le tu rn . T o o l- ca l l- th en -a n sw er t raje c to ri es ( H R ) . In t he f ir st t ur n, th e mode l is su e a too l ca ll se le ct i ng C ⋆ . Af t er th e too l re tu rn s { I hi gh c } c ∈ C ⋆ , th e mod e l is tr a in e d to pr o d uc es a ⋆ in a se c on d tu rn co nd it io ne d on b o th th e lo w- re so lu ti on an d th e re t ri e v e d hi gh - re s ol ut io n cr op s. Th is cu ra ti on pi pel i ne p rod uc es m ul ti -t ur n too l- us e su p e rv is io n at sc a le in or d er to le ar n an in it ia l re fe re n ce pol i cy π θ ref , wh il e k ee pi ng th e cr op in te rf ac e st ru ct ur ed an d de pl o ym en t- fr i en dl y (F ig . 2 ). W e pr o vi d e ad d it io na l de ta il s in th e su pp le m en ta ry ma te ri a l. 3 .3 C ol d- st ar t su per v is ed r ef er en ce po li cy ( SF T) W e co ld -s ta r t ou r cr op -r eq ue st pol ic y b y su per vi se d f in e- tu ni n g (S FT ) on t he mi xt ur e of di re c t- an sw er an d too l- c al l- th en - an sw er tr a je ct or ie s pr odu c ed in §3 .2 . Th is st ag e s er v e s t w o p ur pos e s: (i ) t ea c h th e m ode l t o fo ll o w th e m ul ti - tu r n t ool - ca ll in g pr ot oco l a nd le ar n th e co u pl e d de c is io ns ( w he t he r ad d it io na l de t ai l i s ne e de d a nd wh e r e it ma t te rs ), an d ( ii ) pr odu ce a st r on g su per vi se d r ef er en c e p ol ic y π re f th at w e la te r us e fo r KL -r eg ul a ri ze d GR PO (§ 3. 4 ). 6 N. Sh abt a y, M. Ki mh i et al . O r a c l e D e t e c t i o n B o x e s L o w R e s o l u t i o n Se l e c t e d C r o p Wh a t w e b s i t e i s b ei n g a d v er t i s ed o n t h e p l a n e? J et s t a r . co m P ro m p t : G ro u nd T ru t h A ns w e r: O r a c l e D e t e c t i o n B o x e s L o w R e s o l u t i o n Se l e c t e d C r o p Wh a t i s t h e G r a n d T o t a l f o r N e t B l o c k A s o f 3 1 . 3 . 2 0 1 2 ? 5 2 7 0 8 . 8 6 P ro m p t : G ro u nd T ru t h A ns w e r: F ig . 3: Cr o p an no ta ti on ex a mp le . Le ft : lo w- r es ol u ti on in pu t wh er e te xt is il leg ibl e. Mi dd l e: or acl e-p red ict ed b ou ndi ng bo x loc al iz ing th e an sw er re gi on. Ri gh t: sel ect ed hig h-r eso lut ion cr op ena bli ng co rr ec t re spo ns e (bes t vi ew ed wh en zoo med in ). Le t y 1: T de no te th e as si st an t to k e ns i n a su p e rv is ed tr a ns c ri pt , an d le t h t be th e di al og u e hi st o ry at st e p t (i nc lu d in g ( q,I lo w ) , an y pr e vi ou sl y ge ne r at ed to k en s, an d too l ou tp ut s if a cr o p re que st occ ur r ed ) . W e mi ni mi ze a w ei gh te d ne ga ti v e lo g- l ik el ih ood: L SF T ( θ ) = − T X t = 1 w t lo g π θ ( y t | h t ) (4 ) Th e too l- ca ll tu rn , d es pi te ha vi ng sm al l n u m ber s of to k e ns , fu ll y spe ci fi es th e CD P ac ti on an d ca r ry di sp r opo rt io na te co n tr ol o v er bot h ef fi ci en cy an d do wn st r ea m an s w er qu al it y . Up w ei gh ti n g th is tu rn t he r ef or e di r ec tl y st ab il iz e s le ar ni ng o f th e fu se d fi rs t -t ur n de ci si o n. A ft er SF T, w e fr ee ze th e re su l ti n g mode l as t he r ef er en ce po li cy π re f an d in it ia l iz e GR PO fr om it . A w aR es 7 3 .4 M ul ti -t ur n GR PO Af te r th e co ld -s ta rt SF T s ta ge , th e mod e l re li ab ly fo ll o ws th e too l pr ot o c ol bu t t en ds to o ve r -r e q ue s t cr o ps ev en wh e n I lo w is su ff ic ie n t. W e th er e fo re ap pl y Gr ou p Re la t iv e P ol ic y O pt im iz at i on (G RP O ) on fu ll m ul ti -t u rn in te ra ct io n s to ex pl i ci tl y o pt i mi ze th e ac cu ra c y– ef fi ci e nc y tr ad e -o ff . W e d en ot e b y π re f th e fr oz en SF T po li cy π θ re f ob ta in e d f ro m t he SF T . G RP O i s i ni ti al - iz ed fr om π re f an d us es a KL pen a lt y to k e ep π θ cl os e to π re f wh il e im pr o vin g too l us ag e . R ollo ut s an d tr a je ct or ie s . G iv e n an in pu t pr om pt x = ( q,I lo w ) , th e pol ic y π θ ge ne ra t es fi rs t tu r n th at ma y in cl ud e a cr op too l ca l l. Th e re qu es t ed cr op s ar e ap pen d ed to th e di al og u e co n te xt , an d ge n er at io n co n ti n u es un ti l a fi na l an s w e r ˆ a is pr odu ce d. W e tr ea t on ly as si s ta n t to k en s as ac t io n s; too l ou tp ut s ar e tr e at ed as ob se rv at io ns . Th us , ea c h ro ll ou t y ie ld s a m ul t i- tu rn tr a je ct or y τ co ns is t in g of as sis ta n t a ct i on s in te rl e a v ed wi th too l ob se rv at io ns , en di ng wi t h ˆ a . Un li k e su per v is ed tr ai ni n g wi t h de n se per -t ok en lo s s, GR PO en ab le s op ti m iz a ti on wi th ta sk -s pec if ic re w ar ds th a t di re ct l y ta rg et im p ro v ed too l us ag e. R ew ar d de si gn . W e as s ig n a si ng l e sc al ar re w ar d to t he co mp le te d tr a je c to ry τ , co mpo se d fr om t w o co mpo ne n ts : R ( τ ) = R an s (ˆ a, a ⋆ ) − C too l ( C ,y ) , (5 ) A ns w e r re w a rd ( R an s ( ˆ a, a ⋆ ) ) : me as ur es s em an ti c co rr ec tn es s us in g th e c os in e si mi la ri t y bet w ee n se n te nc e -t ra ns fo rm er em bed d in gs of ˆ a an d a ⋆ . T oo l- us e co st : P en al iz e too l us ag e wi th an as y mm et ri c co st : C too l ( C ,y ) = α mi ss if y = HR an d C = ∅ ( mi ss ed too l- c al l ) α us e + λ ∥ C ∥ i f C = ∅ ( t ool us a ge ) 0 if y = LR an d C = ∅ , (6 ) Th is a sy mm et ry bi as e s th e pol i cy to w ar d r e c all in too l in v oca t io n : mi ss in g a ne ce s sa ry cr op re qu es t is pen al i ze d mo r e he a vi ly th an ma ki n g an un ne ce ss ar y re qu es t. Wh en th e too l is us ed , w e a dd it io na l ly pen al i ze th e am ou nt of hi g h- r es ol ut io n ev id e nc e r e qu e st e d vi a ∥ C ∥ , de f in ed as th e to ta l fr a ct i on of im a ge ar ea co v e re d b y th e s el ec te d cr op s . Th is en co ur a ge s th e pol ic y to pr efe r sm al l er cr op s wh en th ey su f fi c e. Im por t an tl y , th e c os t de pen ds on ho w mu c h is re qu es t ed bu t re ma in s ag no st ic to wh ic h spe ci fi c re gi on is c ho se n , al lo wi ng th e GR PO to ex p lo re al te r na ti v e pol ic ie s . G RP O o pt im iz a ti on . F or ea c h p ro mp t x , w e sa mp l e a gr o up of G tr a je ct or ie s { τ 1 , . .., τ G } fr om th e cu rr en t pol ic y π θ . Ea c h tr a j ec to ry τ i co ns is t s o f a se qu en ce of as si st a n t to k en s (a ct io ns ) in te r le a v ed wi th tool ob se r v at io ns , cu l mi n at in g in a fi n al an sw er . W e co mp ut e th e ad v an ta ge f or e ac h tr a je c to ry u si ng t he g ro up -r el at i v e b as el in e: ˆ A i = R ( τ i ) − µ G σ G + ϵ , (7 ) wh er e R ( τ i ) is t he t o ta l re w ar d fo r tr a je ct or y τ i , an d µ G , σ G ar e th e me an an d st a nd a rd de vi at i on of rew ar ds wi th in th e gr ou p. W e op ti mi ze a PP O- s t yle cl ip ped ob j ec ti v e wi t h KL re gu lar iz at i on to th e re f er en ce pol ic y: 8 N. Sh abt a y, M. Ki mh i et al . L GR PO ( θ ) = E x ∼ D " 1 G G X i = 1 1 | τ i | | τ i | X t = 1 mi n r ( i ) t ˆ A i , c li p ( r ( i ) t , 1 − ϵ, 1 + ϵ ) ˆ A i − β D KL ( π θ ∥ π re f ) # , (8 ) wh er e r ( i ) t = π θ ( a ( i ) t | x ,a ( i )
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment