Dataset Viewer
images
images listlengths 5
50
| text
sequencelengths 5
50
|
---|---|
[
"ColBERT: Efficient and Effective Passage Search via\nContextualized Late Interaction over BERT\nOmarKhattab MateiZaharia\nStanfordUniversity StanfordUniversity\[email protected] [email protected]\nABSTRACT\n105\nRecentprogressinNaturalLanguageUnderstanding(NLU)isdriv-\ningfast-pacedadvancesinInformationRetrieval(IR),largelyowed 104\ntofine-tuningdeeplanguagemodels(LMs)fordocumentranking.\nWhileremarkablyeffective,therankingmodelsbasedontheseLMs 103\nincreasecomputationalcostbyordersofmagnitudeoverpriorap-\nproaches,particularlyastheymustfeedeachquery–documentpair 102\nthroughamassiveneuralnetworktocomputeasinglerelevance\nscore.Totacklethis,wepresentColBERT,anovelrankingmodel 101\nthatadaptsdeepLMs(inparticular,BERT)forefficientretrieval. 0.15 0.20 0.25 0.30 0.35 0.40\nMRR@10\nColBERTintroducesalateinteractionarchitecturethatindepen-\ndentlyencodesthequeryandthedocumentusingBERTandthen\nemploysacheapyetpowerfulinteractionstepthatmodelstheir\nfine-grained similarity. By delaying and yet retaining this fine-\ngranularinteraction,ColBERTcanleveragetheexpressivenessof\ndeepLMswhilesimultaneouslygainingtheabilitytopre-compute\ndocumentrepresentationsoffline,considerablyspeedingupquery\nprocessing.Beyondreducingthecostofre-rankingthedocuments\nretrievedbyatraditionalmodel,ColBERT’spruning-friendly in-\nteractionmechanismenablesleveragingvector-similarityindexes\nforend-to-endretrievaldirectlyfromalargedocumentcollection.\nWeextensivelyevaluateColBERTusingtworecentpassagesearch\ndatasets.ResultsshowthatColBERT’seffectivenessiscompetitive\nwith existing BERT-based models (and outperforms every non-\nBERTbaseline),whileexecutingtwoorders-of-magnitudefaster\nandrequiringfourorders-of-magnitudefewerFLOPsperquery.\nACMReferenceformat:\nOmarKhattabandMateiZaharia.2020.ColBERT:EfficientandEffectivePas-\nsageSearchviaContextualizedLateInteractionoverBERT.InProceedings\nofProceedingsofthe43rdInternationalACMSIGIRConferenceonResearch\nandDevelopmentinInformationRetrieval,VirtualEvent,China,July25–30,\n2020(SIGIR’20),10pages.\nDOI:10.1145/3397271.3401075\n1 INTRODUCTION\nOverthepastfewyears,theInformationRetrieval(IR)community\nhaswitnessedtheintroductionofahostofneuralrankingmodels,\nincludingDRMM[7],KNRM[4,36],andDuet[20,22].Incontrast\nPermissiontomakedigitalorhardcopiesofallorpartofthisworkforpersonalor\nclassroomuseisgrantedwithoutfeeprovidedthatcopiesarenotmadeordistributed\nforprofitorcommercialadvantageandthatcopiesbearthisnoticeandthefullcitation\nonthefirstpage.Copyrightsforcomponentsofthisworkownedbyothersthanthe\nauthor(s)mustbehonored.Abstractingwithcreditispermitted.Tocopyotherwise,or\nrepublish,topostonserversortoredistributetolists,requirespriorspecificpermission\nand/[email protected].\nSIGIR’20,VirtualEvent,China\n©2020Copyrightheldbytheowner/author(s).PublicationrightslicensedtoACM.\n978-1-4503-8016-4/20/07...$15.00\nDOI:10.1145/3397271.3401075\n)sm(\nycnetaL\nyreuQ\nBag-of-Words (BoW) Model\nBoW Model with NLU Augmentation\nNeural Matching Model BERT-large\nDeep Language Model\nBERT-base ColBERT (ours)\nColBERT (full retrieval)\nDuet fT+ConvKNRM\nBM25 KNRMdoc2queryDeepC do T cTTTTTquery ColBERT (re-rank)\nFigure 1: Effectiveness (MRR@10) versus Mean Query La-\ntency (log-scale) for a number of representative ranking\nmodelsonMSMARCORanking[24].Thefigurealsoshows\nColBERT.Neuralre-rankersrunontopoftheofficialBM25\ntop-1000resultsanduseaTeslaV100GPU.Methodologyand\ndetailedresultsarein§4.\ntopriorlearning-to-rankmethodsthatrelyonhand-craftedfea-\ntures,thesemodelsemployembedding-basedrepresentationsof\nqueriesanddocumentsanddirectlymodellocalinteractions(i.e.,\nfine-granularrelationships)betweentheircontents.Amongthem,\narecentapproachhasemergedthatfine-tunes deeppre-trained\nlanguagemodels(LMs)likeELMo[29]andBERT[5]forestimating\nrelevance. Bycomputingdeeply-contextualizedsemanticrepre-\nsentationsofquery–documentpairs,theseLMshelpbridgethe\npervasivevocabularymismatch[21,42]betweendocumentsand\nqueries[30]. Indeed,inthespanofjustafewmonths,anumber\nofrankingmodelsbasedonBERThaveachievedstate-of-the-art\nresultsonvariousretrievalbenchmarks[3,18,25,39]andhave\nbeenproprietarilyadaptedfordeploymentbyGoogle1andBing2.\nHowever,theremarkablegainsdeliveredbytheseLMscome\natasteepincreaseincomputationalcost.Hofsta¨tteretal.[9]and\nMacAvaneyetal.[18]observethatBERT-basedmodelsinthelit-\neratureare100-1000×morecomputationallyexpensivethanprior\nmodels—someofwhicharearguablynotinexpensivetobeginwith\n[13].Thisquality–costtradeoffissummarizedbyFigure1,which\ncomparestwoBERT-basedrankers[25,27]againstarepresentative\nsetofrankingmodels.ThefigureusesMSMARCORanking[24],\na recent collection of 9M passages and 1M queries from Bing’s\nlogs. Itreportsretrievaleffectiveness(MRR@10)ontheofficial\nvalidationsetaswellasaveragequerylatency(log-scale)usinga\nhigh-endserverthatdedicatesoneTeslaV100GPUperqueryfor\nneuralre-rankers.Followingthere-rankingsetupofMSMARCO,\nColBERT(re-rank),theNeuralMatchingModels,andtheDeepLMs\nre-ranktheMSMARCO’sofficialtop-1000documentsperquery.\n1https://blog.google/products/search/search-language-understanding-bert/\n2https://azure.microsoft.com/en-us/blog/bing-delivers-its-largest-improvement-\nin-search-experience-using-azure-gpus/\n0202\nnuJ\n4\n]RI.sc[\n2v23821.4002:viXra",
"s s\nMLP ∑\nCNN / Match Kernels / MLP\nCNN / Match Kernels\nMaxSim MaxSim MaxSim\nQuery Query Document\ntnemucoD\ns s\nQuery Document Query Document\n(a) Representation-based Similarity (b) Query-Document Interaction (c) All-to-all Interaction (d) Late Interaction\n(e.g., DSSM, SNRM) (e.g., DRMM, KNRM, Conv-KNRM) (e.g., BERT) (i.e., the proposed ColBERT)\nFigure2: Schematicdiagramsillustratingquery–documentmatchingparadigmsinneuralIR.Thefigurecontrastsexisting\napproaches(sub-figures(a),(b),and(c))withtheproposedlateinteractionparadigm(sub-figure(d)).\nOthermethods,includingColBERT(fullretrieval),directlyretrieve Theseincreasinglyexpressivearchitecturesareintension.While\nthetop-1000resultsfromtheentirecollection. interaction-basedmodels(i.e.,Figure2(b)and(c))tendtobesu-\nAsthefigureshows,BERTconsiderablyimprovessearchpreci- periorforIRtasks[8,21],arepresentation-focusedmodel—byiso-\nsion,raisingMRR@10byalmost7%againstthebestpreviousmeth- latingthecomputationsamongqandd—makesitpossibletopre-\nods;simultaneously,itincreaseslatencybyuptotensofthousands computedocumentrepresentationsoffline[41],greatlyreducing\nofmillisecondsevenwithahigh-endGPU.Thisposesachallenging thecomputationalloadperquery. Inthiswork,weobservethat\ntradeoffsinceraisingqueryresponsetimesbyaslittleas100msis thefine-grainedmatchingofinteraction-basedmodelsandthepre-\nknowntoimpactuserexperienceandevenmeasurablydiminish computationofdocumentrepresentationsofrepresentation-based\nrevenue[17].Totacklethisproblem,recentworkhasstartedex- modelscanbecombinedbyretainingyetjudiciouslydelayingthe\nploringusingNaturalLanguageUnderstanding(NLU)techniques query–documentinteraction. Figure2(d)illustratesanarchitec-\ntoaugmenttraditionalretrievalmodelslikeBM25[32].Forexam- turethatpreciselydoesso.Asillustrated,everyqueryembedding\nple,Nogueiraetal.[26,28]expanddocumentswithNLU-generated interactswithalldocumentembeddingsviaaMaxSimoperator,\nqueriesbeforeindexingwithBM25scoresandDai&Callan[2]re- whichcomputesmaximumsimilarity(e.g.,cosinesimilarity),and\nplaceBM25’stermfrequencywithNLU-estimatedtermimportance. the scalar outputs of these operators are summed across query\nDespitesuccessfullyreducinglatency,theseapproachesgenerally terms. ThisparadigmallowsColBERTtoexploitdeepLM-based\nreduceprecisionsubstantiallyrelativetoBERT. representationswhileshiftingthecostofencodingdocumentsof-\nToreconcileefficiencyandcontextualizationinIR,wepropose flineandamortizingthecostofencodingthequeryonceacross\nColBERT,arankingmodelbasedoncontextualizedlateinterac- allrankeddocuments.Additionally,itenablesColBERTtolever-\ntionoverBERT.Asthenamesuggests,ColBERTproposesanovel agevector-similaritysearchindexes(e.g.,[1,15])toretrievethe\nlateinteractionparadigmforestimatingrelevancebetweenaquery top-k resultsdirectlyfromalargedocumentcollection,substan-\nqandadocumentd.Underlateinteraction,qanddareseparately tiallyimprovingrecallovermodelsthatonlyre-ranktheoutputof\nencodedintotwosetsofcontextualembeddings,andrelevanceis term-basedretrieval.\nevaluatedusingcheapandpruning-friendlycomputationsbetween AsFigure1illustrates, ColBERTcanservequeriesintensor\nbothsets—thatis,fastcomputationsthatenablerankingwithout few hundreds of milliseconds. For instance, when used for re-\nexhaustivelyevaluatingeverypossiblecandidate. rankingasin“ColBERT(re-rank)”,itdeliversover170×speedup\nFigure2contrastsourproposedlateinteractionapproachwith (andrequires14,000×fewerFLOPs)relativetoexistingBERT-based\nexistingneuralmatchingparadigms.Ontheleft,Figure2(a)illus- models,whilebeingmoreeffectivethaneverynon-BERTbaseline\ntratesrepresentation-focusedrankers,whichindependentlycompute (§4.2&4.3). ColBERT’sindexing—theonlytimeitneedstofeed\nanembeddingforqandanotherford andestimaterelevanceas documentsthroughBERT—isalsopractical: itcanindextheMS\nasinglesimilarityscorebetweentwovectors[12,41].Movingto MARCOcollectionof9Mpassagesinabout3hoursusingasingle\ntheright,Figure2(b)visualizestypicalinteraction-focusedrankers. serverwithfourGPUs(§4.5),retainingitseffectivenesswithaspace\nInsteadofsummarizingqanddintoindividualembeddings,these footprintofaslittleasfewtensofGiBs. Ourextensiveablation\nrankersmodelword-andphrase-levelrelationshipsacrossqandd study (§4.4) shows that late interaction, its implementation via\nandmatchthemusingadeepneuralnetwork(e.g.,withCNNs/MLPs MaxSimoperations,andcrucialdesignchoiceswithinourBERT-\n[22]orkernels[36]).Inthesimplestcase,theyfeedtheneuralnet- basedencodersareallessentialtoColBERT’seffectiveness.\nwork an interaction matrix that reflects the similiarity between Ourmaincontributionsareasfollows.\neverypairofwordsacrossqandd.Furtherright,Figure2(c)illus-\n(1) Weproposelateinteraction(§3.1)asaparadigmforefficient\ntratesamorepowerfulinteraction-basedparadigm,whichmodels\nandeffectiveneuralranking.\ntheinteractionsbetweenwordswithinaswellasacrossqanddat\n(2) WepresentColBERT(§3.2&3.3),ahighly-effectivemodel\nthesametime,asinBERT’stransformerarchitecture[25].\nthatemploysnovelBERT-basedqueryanddocumenten-\ncoderswithinthelateinteractionparadigm.",
"(3) WeshowhowtoleverageColBERTbothforre-rankingon\nscore\ntopofaterm-basedretrievalmodel(§3.5)andforsearching\nafullcollectionusingvectorsimilarityindexes(§3.6).\n(4) WeevaluateColBERTonMSMARCOandTRECCAR,two\nMaxSim MaxSim MaxSim\nrecentpassagesearchcollections.\nQuery Encoder, f Document Encoder, f\n2 RELATEDWORK Q D\nNeuralMatchingModels.Overthepastfewyears,IRresearchers\nhaveintroducednumerousneuralarchitecturesforranking. In\nQuery Document\nthiswork,wecompareagainstKNRM[4,36],Duet[20,22],Con-\nvKNRM [4], and fastText+ConvKNRM [10]. KNRM proposes a\ndifferentiablekernel-poolingtechniqueforextractingmatching\nsignalsfromaninteractionmatrix,whileDuetcombinessignals\nfromexact-match-basedaswellasembedding-basedsimilarities\nforranking. Introducedin2018,ConvKNRMlearnstomatchn-\ngramsinthequeryandthedocument.Lastly,fastText+ConvKNRM\n(abbreviatedfT+ConvKNRM)tacklestheabsenceofrarewords\nfromtypicalwordembeddingslistsbyadoptingsub-wordtoken\nembeddings.\nIn2018,Zamanietal.[41]introducedSNRM,arepresentation-\nfocusedIRmodelthatencodeseachqueryandeachdocumentas\nasingle,sparsehigh-dimensionalvectorof“latentterms”.Bypro-\nducingasparse-vectorrepresentationforeachdocument,SNRM\nisabletouseatraditionalIRinvertedindexforrepresentingdocu-\nments,allowingfastend-to-endretrieval.Despitehighlypromising\nresultsandinsights,SNRM’seffectivenessissubstantiallyoutper-\nformedbythestateoftheartonthedatasetswithwhichitwas\nevaluated(e.g.,see[18,38]).WhileSNRMemployssparsitytoal-\nlowusinginvertedindexes,werelaxthisassumptionandcompare\na(dense)BERT-basedrepresentation-focusedmodelagainstour\nlate-interactionColBERTinourablationexperimentsin§4.4.Fora\ndetailedoverviewofexistingneuralrankingmodels,wereferthe\nreaderstotworecentsurveysoftheliterature[8,21].\nLanguage Model Pretraining for IR. Recent work in NLU\nemphasizestheimportancepre-traininglanguagerepresentation\nmodelsinanunsupervisedfashionbeforesubsequentlyfine-tuning\nthemondownstreamtasks.AnotableexampleisBERT[5],abi-\ndirectionaltransformer-basedlanguagemodelwhosefine-tuning\nadvancedthestateoftheartonvariousNLUbenchmarks.Nogueiraet\nal.[25],MacAvaneyetal.[18],andDai&Callan[3]investigate\nincorporatingsuchLMs(mainlyBERT,butalsoELMo[29])ondif-\nferentrankingdatasets.AsillustratedinFigure2(c),thecommon\napproach(andtheoneadoptedbyNogueiraetal.onMSMARCO\nandTRECCAR)istofeedthequery–documentpairthroughBERT\nanduseanMLPontopofBERT’s[CLS]outputtokentoproducea\nrelevancescore.SubsequentworkbyNogueiraetal.[27]introduced\nduoBERT,whichfine-tunesBERTtocomparetherelevanceofa\npairofdocumentsgivenaquery.Relativetotheirsingle-document\nBERT,thisgivesduoBERTa1%MRR@10advantageonMSMARCO\nwhileincreasingthecostbyatleast1.4×.\nBERT Optimizations. As discussed in §1, these LM-based\nrankerscanbehighlyexpensiveinpractice. Whileongoingef-\nfortsintheNLUliteraturefordistilling[14,33],compressing[40],\nandpruning[19]BERTcanbeinstrumentalinnarrowingthisgap,\ngnixednI\nenilffO\nFigure3:ThegeneralarchitectureofColBERTgivenaquery\nqandadocumentd.\ntheygenerallyachievesignificantlysmallerspeedupsthanourre-\ndesignedarchitectureforIR,duetotheirgenericnature,andmore\naggressiveoptimizationsoftencomeatthecostoflowerquality.\nEfficientNLU-basedModels. Recently,adirectionemerged\nthatemploysexpensiveNLUcomputationoffline. Thisincludes\ndoc2query[28]andDeepCT[2]. Thedoc2querymodelexpands\neachdocumentwithapre-definednumberofsyntheticqueries\nqueriesgeneratedbyaseq2seqtransformermodelthatistrainedto\ngeneratequeriesgivenadocument.ItthenreliesonaBM25index\nforretrievalfromthe(expanded)documents.DeepCTusesBERT\ntoproducethetermfrequencycomponentofBM25inacontext-\nawaremanner,essentiallyrepresentingafeasiblerealizationofthe\nterm-independenceassumptionwithneuralnetworks[23].Lastly,\ndocTTTTTquery[26]isidenticaltodoc2queryexceptthatitfine-\ntunes a pre-trained model (namely, T5 [31]) for generating the\npredictedqueries.\nConcurrentlywithourdraftingofthispaper,Hofsta¨tteretal.[11]\npublishedtheirTransformer-Kernel(TK)model.Atahighlevel,TK\nimprovestheKNRMarchitecturedescribedearlier:whileKNRM\nemployskernelpoolingontopofword-embedding-basedinter-\naction,TKusesaTransformer[34]componentforcontextually\nencodingqueriesanddocumentsbeforekernelpooling.TKestab-\nlishesanewstate-of-the-artfornon-BERTmodelsonMSMARCO\n(Dev);however,thebestnon-ensembleMRR@10itachievesis31%\nwhileColBERTreachesupto36%.Moreover,duetoindexingdocu-\nmentrepresentationsofflineandemployingaMaxSim-basedlate\ninteractionmechanism,ColBERTismuchmorescalable,enabling\nend-to-endretrievalwhichisnotsupportedbyTK.\n3 COLBERT\nColBERTprescribesasimpleframeworkforbalancingthequality\nandcostofneuralIR,particularlydeeplanguagemodelslikeBERT.\nAsintroducedearlier,delayingthequery–documentinteractioncan\nfacilitatecheapneuralre-ranking(i.e.,throughpre-computation)\nandevensupportpracticalend-to-endneuralretrieval(i.e.,through\npruningviavector-similaritysearch).ColBERTaddresseshowto\ndo so while still preserving the effectiveness of state-of-the-art\nmodels, whichconditionthebulkoftheircomputationsonthe\njointquery–documentpair.",
"EventhoughColBERT’slate-interactionframeworkcanbeap- deeptransformerarchitecture,whichcomputesacontextualized\npliedtoawidevarietyofarchitectures(e.g.,CNNs,RNNs,trans- representationofeachtoken.\nformers,etc.),wechoosetofocusthisworkonbi-directionaltransformer- Wedenotethepaddingwithmaskedtokensasqueryaugmen-\nbasedencoders(i.e.,BERT)owingtotheirstate-of-the-arteffective- tation,astepthatallowsBERTtoproducequery-basedembeddings\nnessyetveryhighcomputationalcost. atthepositionscorrespondingtothesemasks.Queryaugmentation\nisintendedtoserveasasoft,differentiablemechanismforlearning\ntoexpandquerieswithnewtermsortore-weighexistingterms\n3.1 Architecture\nbasedontheirimportanceformatchingthequery.Asweshowin\nFigure3depictsthegeneralarchitectureofColBERT,whichcom- §4.4,thisoperationisessentialforColBERT’seffectiveness.\nprises:(a)aqueryencoderfQ ,(b)adocumentencoderfD ,and(c) GivenBERT’srepresentationofeachtoken,ourencoderpasses\nthelateinteractionmechanism.Givenaqueryqanddocumentd, thecontextualizedoutputrepresentationsthroughalinearlayer\nfQ encodesqintoabagoffixed-sizeembeddingsEq whilefD en- withnoactivations. Thislayerservestocontrolthedimension\ncodesdintoanotherbagE\nd\n.Crucially,eachembeddingsinEq and ofColBERT’sembeddings,producingm-dimensionalembeddings\nE iscontextualizedbasedontheothertermsinqord,respectively. forthelayer’soutputsizem. Aswediscusslaterinmoredetail,\nd\nWedescribeourBERT-basedencodersin§3.2. wetypicallyfixmtobemuchsmallerthanBERT’sfixedhidden\nUsingEq andE\nd\n, ColBERTcomputestherelevancescorebe- dimension.\ntweenqanddvialateinteraction,whichwedefineasasummation WhileColBERT’sembeddingdimensionhaslimitedimpacton\nofmaximumsimilarity(MaxSim)operators.Inparticular,wefind theefficiencyofqueryencoding,thisstepiscrucialforcontrolling\nthemaximumcosinesimilarityofeachv ∈Eq withvectorsinE\nd\n, thespacefootprintofdocuments,asweshowin§4.5.Inaddition,it\nandcombinetheoutputsviasummation.Besidescosine,wealso canhaveasignificantimpactonqueryexecutiontime,particularly\nevaluatesquaredL2distanceasameasureofvectorsimilarity.In- thetimetakenfortransferringthedocumentrepresentationsonto\ntuitively,thisinteractionmechanismsoftlysearchesforeachquery theGPUfromsystemmemory(wheretheyresidebeforeprocessing\ntermtq —inamannerthatreflectsitscontextinthequery—against a query). In fact, as we show in §4.2, gathering, stacking, and\nthedocument’sembeddings,quantifyingthestrengthofthe“match” transferringtheembeddingsfromCPUtoGPUcanbethemost\nviathelargestsimilarityscorebetweentq andadocumenttermt\nd\n. expensivestepinre-rankingwithColBERT.Finally, theoutput\nGiventhesetermscores,itthenestimatesthedocumentrelevance embeddings are normalized so each has L2 norm equal to one.\nbysummingthematchingevidenceacrossallqueryterms. Theresultisthatthedot-productofanytwoembeddingsbecomes\nWhilemoresophisticatedmatchingispossiblewithotherchoices equivalenttotheircosinesimilarity,fallinginthe[−1,1]range.\nsuchasdeepconvolutionandattentionlayers(i.e.,asintypical DocumentEncoder.Ourdocumentencoderhasaverysimilar\ninteraction-focusedmodels),asummationofmaximumsimilarity architecture.Wefirstsegmentadocumentdintoitsconstituentto-\ncomputationshastwodistinctivecharacteristics. First,itstands kensd1d2...dm ,towhichweprependBERT’sstarttoken[CLS]fol-\noutasaparticularlycheapinteractionmechanism,asweexamine lowedbyourspecialtoken[D]thatindicatesadocumentsequence.\nitsFLOPsin§4.2. Second,andmoreimportantly,itisamenable Unlikequeries,wedonotappend[mask]tokenstodocuments.Af-\ntohighly-efficientpruningfortop-k retrieval,asweevaluatein terpassingthisinputsequencethroughBERTandthesubsequent\n§4.3.Thisenablesusingvector-similarityalgorithmsforskipping linearlayer,thedocumentencoderfiltersouttheembeddingscorre-\ndocumentswithoutmaterializingthefullinteractionmatrixoreven spondingtopunctuationsymbols,determinedviaapre-definedlist.\nconsideringeachdocumentinisolation.Othercheapchoices(e.g., Thisfilteringismeanttoreducethenumberofembeddingsperdoc-\nasummationofaveragesimilarityscores,insteadofmaximum)are ument,aswehypothesizethat(evencontextualized)embeddings\npossible;however,manyarelessamenabletopruning.In§4.4,we ofpunctuationareunnecessaryforeffectiveness.\nconductanextensiveablationstudythatempiricallyverifiesthead- Insummary,givenq=q0q1...q\nl\nandd =d0d1...dn ,wecompute\nvantageofourMaxSim-basedlateinteractionagainstalternatives. thebagsofembeddingsEq andE\nd\ninthefollowingmanner,where\n#referstothe[mask]tokens:\n3.2 Query&DocumentEncoders\nPriortolateinteraction,ColBERTencodeseachqueryordocument\nintoabagofembeddings,employingBERT-basedencoders. We\nEq :=Normalize(CNN(BERT(“[Q]q0q1...q\nl\n##...#”))) (1)\nshareasingleBERTmodelamongourqueryanddocumenten- E d :=Filter(Normalize(CNN(BERT(“[D]d0d1...dn ”)))) (2)\ncodersbutdistinguishinputsequencesthatcorrespondtoqueries\nanddocumentsbyprependingaspecialtoken[Q]toqueriesand\n3.3 LateInteraction\nanothertoken[D]todocuments.\nQueryEncoder.Givenatextualqueryq,wetokenizeitintoits Giventherepresentationofaqueryqandadocumentd,therel-\nBERT-basedWordPiece[35]tokensq1q2...q\nl\n.Weprependthetoken evancescoreofd toq, denotedasS\nq,d\n, isestimatedvialatein-\n[Q]tothequery.WeplacethistokenrightafterBERT’ssequence- teractionbetweentheirbagsofcontextualizedembeddings. As\nstarttoken[CLS].Ifthequeryhasfewerthanapre-definednumber mentionedbefore, thisisconductedasasumofmaximumsim-\nof tokens Nq , we pad it with BERT’s special [mask] tokens up ilarity computations, namely cosine similarity (implemented as\nto length Nq (otherwise, we truncate it to the first Nq tokens). dot-productsduetotheembeddingnormalization)orsquaredL2\nThispaddedsequenceofinputtokensisthenpassedintoBERT’s distance.",
"(unlikeourapproachin§3.6).Tobeginwith,ourqueryservingsub-\n(cid:213) systemloadstheindexeddocumentsrepresentationsintomemory,\nS q,d := i∈[|Eq |] j∈ m [| a E x d |] Eqi ·ET dj (3) rep G re iv se e n n ti a n q g u e e a r c y h q d , o w c e um co e m nt p a u s te a i m ts a b tr a i g x o o f f c e o m n b te e x d t d u in al g i s z . edembed-\nColBERTisdifferentiableend-to-end. Wefine-tunetheBERT dingsEq (Equation1)and,concurrently,gatherthedocumentrepre-\nencodersandtrainfromscratchtheadditionalparameters(i.e.,the sentationsintoa3-dimensionaltensorDconsistingofkdocument\nlinearlayerandthe[Q]and[D]markers’embeddings)usingthe matrices. Wepadthek documentstotheirmaximumlengthto\nAdam[16]optimizer.Noticethatourinteractionmechanismhas facilitatebatchedoperations,andmovethetensorDtotheGPU’s\nnotrainableparameters. Givenatriple(cid:104)q,d + ,d−(cid:105)withqueryq, memory.OntheGPU,wecomputeabatchdot-productofEq and\npositivedocumentd +andnegativedocumentd−,ColBERTisused D,possiblyovermultiplemini-batches.Theoutputmaterializesa\ntoproduceascoreforeachdocumentindividuallyandisoptimized 3-dimensionaltensorthatisacollectionofcross-matchmatrices\nviapairwisesoftmaxcross-entropylossoverthecomputedscores betweenqandeachdocument.Tocomputethescoreofeachdocu-\nofd +andd−. ment,wereduceitsmatrixacrossdocumenttermsviaamax-pool\n(i.e.,representinganexhaustiveimplementationofourMaxSim\n3.4 OfflineIndexing: Computing&Storing computation)andreduceacrossquerytermsviaasummation.Fi-\nDocumentEmbeddings nally,wesortthekdocumentsbytheirtotalscores.\nRelative to existing neural rankers (especially, but not exclu-\nBydesign,ColBERTisolatesalmostallofthecomputationsbetween\nsively,BERT-basedones),thiscomputationisverycheapthat,in\nqueriesanddocuments,largelytoenablepre-computingdocument\nfact,itscostisdominatedbythecostofgatheringandtransferring\nrepresentationsoffline.Atahighlevel,ourindexingprocedureis\nthepre-computedembeddings.Toillustrate,rankingkdocuments\nstraight-forward:weproceedoverthedocumentsinthecollection\nviatypicalBERTrankersrequiresfeedingBERTkdifferentinputs\ni\ns\nn\nto\nb\nr\na\nin\ntc\ng\nh\nt\ne\nh\ns\ne\n,r\no\nu\nu\nn\ntp\nn\nu\nin\nt\ng\nem\nou\nb\nr\ned\nd\nd\no\ni\nc\nn\nu\ng\nm\ns\ne\np\nn\ne\nt\nr\ne\nd\nn\no\nc\nc\no\nu\nd\nm\ne\ne\nr\nn\nf\nt\nD\n.A\no\nl\nn\nth\ne\no\na\nu\nc\ng\nh\nh\nb\ni\na\nn\nt\nd\nch\nex\na\ni\nn\nn\nd\ng\neachoflengthl =|q|+|di |forqueryqanddocumentsdi ,where\nattentionhasquadraticcostinthelengthofthesequence.Incon-\na set of documents is an offline process, we incorporate a few\ntrast,ColBERTfeedsBERTonlyasingle,muchshortersequenceof\nsimpleoptimizationsforenhancingthethroughputofindexing.As\nlengthl =|q|.Consequently,ColBERTisnotonlycheaper,italso\nweshowin§4.5,theseoptimizationscanconsiderablyreducethe\nscalesmuchbetterwithkasweexaminein§4.2.\nofflinecostofindexing.\nTobeginwith,weexploitmultipleGPUs,ifavailable,forfaster 3.6 End-to-endTop-k RetrievalwithColBERT\nencodingofbatchesofdocumentsinparallel.Whenbatching,we\nAsmentionedbefore,ColBERT’slate-interactionoperatorisspecifi-\npadalldocumentstothemaximumlengthofadocumentwithin\ncallydesignedtoenableend-to-endretrievalfromalargecollection,\nthebatch.3 Tomakecappingthesequencelengthonaper-batch\nlargelytoimproverecallrelativetoterm-basedretrievalapproaches.\nbasismoreeffective,ourindexerproceedsthroughdocumentsin\nThissectionisconcernedwithcaseswherethenumberofdocu-\ngroupsofB(e.g.,B=100,000)documents.Itsortsthesedocuments\nmentstoberankedistoolargeforexhaustiveevaluationofeach\nbylengthandthenfeedsbatchesofb(e.g.,b =128)documentsof\npossiblecandidatedocument,particularlywhenweareonlyinter-\ncomparablelengththroughourencoder.Thislength-basedbucket-\nestedinthehighestscoringones. Concretely,wefocushereon\ningissometimesreferedtoasaBucketIteratorinsomelibraries\n(e.g.,allenNLP).Lastly,whilemostcomputationsoccurontheGPU,\nretrievingthetop-kresultsdirectlyfromalargedocumentcollec-\nwefoundthatanon-trivialportionoftheindexingtimeisspenton\ntionwithN (e.g.,N =10,000,000)documents,wherek (cid:28)N.\nTodoso,weleveragethepruning-friendlynatureoftheMaxSim\npre-processingthetextsequences,primarilyBERT’sWordPieceto-\noperationsatthebackboneoflateinteraction. Insteadofapply-\nkenization.Exploitingthattheseoperationsareindependentacross\ningMaxSimbetweenoneofthequeryembeddingsandallofone\ndocumentsinabatch,weparallelizethepre-processingacrossthe\ndocument’s embeddings, we can use fast vector-similarity data\navailableCPUcores.\nstructures to efficiently conduct this search between the query\nOncethedocumentrepresentationsareproduced,theyaresaved\nembeddingandall documentembeddingsacrossthefullcollec-\ntodiskusing32-bitor16-bitvaluestorepresenteachdimension.\ntion. Forthis,weemployanoff-the-shelflibraryforlarge-scale\nAswedescribein§3.5and3.6, theserepresentationsareeither\nvector-similaritysearch,namelyfaiss[15]fromFacebook.4Inpar-\nsimplyloadedfromdiskforrankingoraresubsequentlyindexed\nticular,attheendofofflineindexing(§3.4),wemaintainamapping\nforvector-similaritysearch,respectively.\nfromeachembeddingtoitsdocumentoforiginandthenindexall\n3.5 Top-k Re-rankingwithColBERT\ndocumentembeddingsintofaiss.\nSubsequently,whenservingqueries,weuseatwo-stagepro-\nRecallthatColBERTcanbeusedforre-rankingtheoutputofan- ceduretoretrievethetop-kdocumentsfromtheentirecollection.\notherretrievalmodel, typicallyaterm-basedmodel, ordirectly BothstagesrelyonColBERT’sscoring:thefirstisanapproximate\nforend-to-endretrievalfromadocumentcollection. Inthissec- stageaimedatfilteringwhilethesecondisarefinementstage.For\ntion,wediscusshowweuseColBERTforrankingasmallsetof thefirststage,weconcurrentlyissueNq vector-similarityqueries\nk(e.g.,k =1000)documentsgivenaqueryq.Sincekissmall,we (correspondingtoeachoftheembeddingsinEq )ontoourfaissin-\nrelyonbatchcomputationstoexhaustivelyscoreeachdocument dex.Thisretrievesthetop-k(cid:48)(e.g.,k(cid:48)=k/2)matchesforthatvector\n3ThepublicBERTimplementationswesawsimplypadtoapre-definedlength. 4https://github.com/facebookresearch/faiss",
"overalldocumentembeddings.Wemapeachofthosetoitsdocu- sets)asa“local”evaluationset. Alongwiththeofficialdevelop-\nmentoforigin,producingNq ×k(cid:48)documentIDs,onlyK ≤Nq ×k(cid:48) mentset,weusethisheld-outsetfortestingourmodelsaswellas\nofwhichareunique.TheseKdocumentslikelycontainoneormore baselinesin§4.3.Wedosotoavoidsubmittingmultiplevariants\nembeddingsthatarehighlysimilartothequeryembeddings.For ofthesamemodelatonce,astheorganizersdiscouragetoomany\nthesecondstage,werefinethissetbyexhaustivelyre-rankingonly submissionsbythesameteam.\nthoseK documentsintheusualmannerdescribedin§3.5. TRECCAR.IntroducedbyDietz[6]etal.in2017,TRECCAR\nInourfaiss-basedimplementation,weuseanIVFPQindex(“in- isasyntheticdatasetbasedonWikipediathatconsistsofabout\nvertedfilewithproductquantization”). Thisindexpartitionsthe 29Mpassages.Similartorelatedwork[25],weusethefirstfourof\nembeddingspaceintoP(e.g.,P =1000)cellsbasedonk-meansclus- fivepre-definedfoldsfortrainingandthefifthforvalidation.This\nteringandthenassignseachdocumentembeddingtoitsnearestcell amountstoroughly3Mqueriesgeneratedbyconcatenatingthe\nbasedontheselectedvector-similaritymetric.Forservingqueries, titleofaWikipediapagewiththeheadingofoneofitssections.\nwhensearchingforthetop-k(cid:48)matchesforasinglequeryembed- Thatsection’spassagesaremarkedasrelevanttothecorresponding\nding,onlythenearestp(e.g.,p =10)partitionsaresearched. To query.OurevaluationisconductedonthetestsetusedinTREC\nimprovememoryefficiency,everyembeddingisdividedintos(e.g., 2017CAR,whichcontains2,254queries.\ns = 16)sub-vectors,eachrepresentedusingonebyte. Moreover,\ntheindexconductsthesimilaritycomputationsinthiscompressed 4.1.2 Implementation. OurColBERTmodelsareimplemented\ndomain,leadingtocheapercomputationsandthusfastersearch. usingPython3andPyTorch1.Weusethepopulartransformers 5\nlibraryforthepre-trainedBERTmodel.Similarto[25],wefine-tune\nallColBERTmodelswithlearningrate3×10−6withabatchsize\n4 EXPERIMENTALEVALUATION 32.WefixthenumberofembeddingsperqueryatNq =32.Weset\nWenowturnourattentiontoempiricallytestingColBERT,address-\nourColBERTembeddingdimensionmtobe128;§4.5demonstrates\nColBERT’srobustnesstoawiderangeofembeddingdimensions.\ningthefollowingresearchquestions.\nForMSMARCO,weinitializetheBERTcomponentsoftheCol-\nRQ :Inatypicalre-rankingsetup,howwellcanColBERTbridge\n1\nBERTqueryanddocumentencodersusingGoogle’sofficialpre-\ntheexistinggap(highlightedin§1)betweenhighly-efficientand\ntrainedBERT model.Further,wetrainallmodelsfor200kitera-\nhighly-effectiveneuralmodels?(§4.2) base\ntions.ForTRECCAR,wefollowrelatedwork[2,25]anduseadif-\nRQ :Beyondre-ranking,canColBERTeffectivelysupportend-\n2\nferentpre-trainedmodeltotheofficialones.Toexplain,theofficial\nto-endretrievaldirectlyfromalargecollection?(§4.3)\nBERTmodelswerepre-trainedonWikipedia,whichisthesource\nRQ :WhatdoeseachcomponentofColBERT(e.g.,lateinterac-\n3\nofTRECCAR’strainingandtestsets. Toavoidleakingtestdata\ntion,queryaugmentation)contributetoitsquality?(§4.4)\nintotrain,NogueiraandCho’s[25]pre-trainarandomly-initialized\nRQ : WhatareColBERT’sindexing-relatedcostsintermsof\n4\nBERTmodelontheWikipagescorrespondingtotrainingsubsetof\nofflinecomputationandmemoryoverhead?(§4.5)\nTRECCAR.TheyreleasetheirBERT pre-trainedmodel,which\nlarge\nwefine-tuneforColBERT’sexperimentsonTRECCAR.Sincefine-\n4.1 Methodology tuningthismodelissignificantlyslowerthanBERT ,wetrain\nbase\nonTRECCARforonly125kiterations.\n4.1.1 Datasets&Metrics. Similartorelatedwork[2,27,28],\nInourre-rankingresults,unlessstatedotherwise,weuse4bytes\nwe conduct our experiments on the MS MARCO Ranking [24]\nperdimensioninourembeddingsandemploycosineasourvector-\n(henceforth,MSMARCO)andTRECComplexAnswerRetrieval\nsimilarityfunction.Forend-to-endranking,weuse(squared)L2\n(TREC-CAR)[6]datasets. Bothoftheserecentdatasetsprovide\nlargetrainingdataofthescalethatfacilitatestrainingandevaluat-\ndistance,aswefoundourfaissindexwasfasteratL2-basedre-\ningdeepneuralnetworks.Wedescribebothindetailbelow.\ntrieval. Forourfaissindex,wesetthenumberofpartitionsto\nMSMARCO.MSMARCOisadataset(andacorresponding P =2,000,andsearchthenearestp=10toeachqueryembeddingto\ncompetition)introducedbyMicrosoftin2016forreadingcompre-\nretrievek(cid:48)=k =1000documentvectorsperqueryembedding.We\nhensionandadaptedin2018forretrieval.Itisacollectionof8.8M\ndivideeachembeddingintos =16sub-vectors,eachencodedusing\nonebyte.Torepresenttheindexusedforthesecondstageofour\npassagesfromWebpages,whichweregatheredfromBing’sresults\nend-to-endretrievalprocedure,weuse16-bitvaluesperdimension.\nto 1M real-world queries. Each query is associated with sparse\nrelevancejudgementsofone(orveryfew)documentsmarkedas\n4.1.3 Hardware&TimeMeasurements. Toevaluatethelatency\nrelevantandnodocumentsexplicitlyindicatedasirrelevant.Per\nofneuralre-rankingmodelsin§4.2,weuseasingleTeslaV100GPU\ntheofficialevaluation,weuseMRR@10tomeasureeffectiveness.\nthathas32GiBsofmemoryonaserverwithtwoIntelXeonGold\nWeusethreesetsofqueriesforevaluation. Theofficialdevel-\n6132CPUs,eachwith14physicalcores(24hyperthreads),and469\nopmentandevaluationsetscontainroughly7kqueries.However,\nGiBsofRAM.ForthemostlyCPU-basedretrievalexperimentsin\ntherelevancejudgementsoftheevaluationsetareheld-outbyMi-\n§4.3andtheindexingexperimentsin§4.5,weuseanotherserver\ncrosoftandeffectivenessresultscanonlybeobtainedbysubmitting\nwiththesameCPUandsystemmemoryspecificationsbutwhich\ntothecompetition’sorganizers.Wesubmittedourmainre-ranking\nhasfourTitanVGPUsattached, eachwith12GiBsofmemory.\nColBERTmodelfortheresultsin§4.2.Inaddition,thecollection\nAcrossallexperiments,onlyoneGPUisdedicatedperqueryfor\nincludesroughly55kqueries(withlabels)thatareprovidedasad-\nditionalvalidationdata. Were-purposearandomsampleof5k\nqueriesamongthose(i.e.,onesnotinourdevelopmentortraining 5https://github.com/huggingface/transformers",
"Method MRR@10(Dev) MRR@10(Eval) Re-rankingLatency(ms) FLOPs/query\nBM25(official) 16.7 16.5 - -\nKNRM 19.8 19.8 3 592M(0.085×)\nDuet 24.3 24.5 22 159B(23×)\nfastText+ConvKNRM 29.0 27.7 28 78B(11×)\nBERT\nbase\n[25] 34.7 - 10,700 97T(13,900×)\nBERT\nbase\n(ourtraining) 36.0 - 10,700 97T(13,900×)\nBERT\nlarge\n[25] 36.5 35.9 32,900 340T(48,600×)\nColBERT(overBERT\nbase\n) 34.9 34.9 61 7B(1×)\nTable 1: “Re-ranking” results on MS MARCO. Each neural model re-ranks the official top-1000 results produced by BM25.\nLatencyisreportedforre-rankingonly.Toobtaintheend-to-endlatencyinFigure1,weaddtheBM25latencyfromTable2.\nMethod MRR@10(Dev) MRR@10(LocalEval) Latency(ms) Recall@50 Recall@200 Recall@1000\nBM25(official) 16.7 - - - - 81.4\nBM25(Anserini) 18.7 19.5 62 59.2 73.8 85.7\ndoc2query 21.5 22.8 85 64.4 77.9 89.1\nDeepCT 24.3 - 62(est.) 69[2] 82[2] 91[2]\ndocTTTTTquery 27.7 28.4 87 75.6 86.9 94.7\nColBERT (re-rank) 34.8 36.4 - 75.3 80.5 81.4\nL2\nColBERT (end-to-end) 36.0 36.7 458 82.9 92.3 96.8\nL2\nTable2:End-to-endretrievalresultsonMSMARCO.Eachmodelretrievesthetop-1000documentsperquerydirectlyfromthe\nentire8.8Mdocumentcollection.\nretrieval(i.e.,formethodswithneuralcomputations)butweuse documentsonline,leavingonlyanegligiblecost.Weestimatethe\nuptoallfourGPUsduringindexing. FLOPsperqueryofeachmodelusingthetorchprofile6library.\nWenowproceedtostudytheresults,whicharereportedinTa-\nble1. Tobeginwith,wenoticethefastprogressfromKNRMin\n2017totheBERT-basedmodelsin2019,manifestingitselfinover\n4.2 Quality–CostTradeoff: Top-k Re-ranking\n16%increaseinMRR@10. Asdescribedin§1,thesimultaneous\nInthissection,weexamineColBERT’sefficiencyandeffectiveness increaseincomputationalcostisdifficulttomiss.Judgingbytheir\natre-rankingthetop-kresultsextractedbyabag-of-wordsretrieval rathermonotonicpatternofincreasinglylargercostandhigheref-\nmodel,whichisthemosttypicalsettingfortestinganddeploying fectiveness,theseresultsappeartopaintapicturewhereexpensive\nneuralrankingmodels.WebeginwiththeMSMARCOdataset.We modelsarenecessaryforhigh-qualityranking.\ncompareagainstKNRM,Duet,andfastText+ConvKNRM,arepre- Incontrastwiththistrend,ColBERT(whichemployslateinter-\nsentativesetofneuralmatchingmodelsthathavebeenpreviously actionoverBERT )performsnoworsethantheoriginaladap-\nbase\ntestedonMSMARCO.Inaddition,wecompareagainstthenat- tationofBERT forrankingbyNogueiraandCho[25,27]and\nbase\nuraladaptationofBERTforrankingbyNogueiraandCho[25], isonlymarginallylesseffectivethanBERT andourtraining\nlarge\ninparticular,BERT base anditsdeepercounterpartBERT large .We ofBERT base (describedabove).Whilehighlycompetitiveineffec-\nalsoreportresultsfor“BERT base (ourtraining)”,whichisbasedon tiveness,ColBERTisordersofmagnitudecheaperthanBERT base ,\nNogueiraandCho’sbasemodel(includinghyperparameters)but inparticular,byover170×inlatencyand13,900×inFLOPs.This\nistrainedwiththesamelossfunctionasColBERT(§3.3)for200k highlightstheexpressivenessofourproposedlateinteractionmech-\niterations,allowingforamoredirectcomparisonoftheresults. anism,particularlywhencoupledwithapowerfulpre-trainedLM\nWereportthecompetition’sofficialmetric,namelyMRR@10, likeBERT.WhileColBERT’sre-rankinglatencyisslightlyhigher\nonthevalidationset(Dev)andtheevaluationset(Eval).Wealso thanthenon-BERTre-rankingmodelsshown(i.e.,by10sofmil-\nreportthere-rankinglatency,whichwemeasureusingasingle liseconds),thisdifferenceisexplainedbythetimeittakestogather,\nTeslaV100GPU,andtheFLOPsperqueryforeachneuralranking stack,andtransferthedocumentembeddingstotheGPU.Inpartic-\nmodel. ForColBERT,ourreportedlatencysubsumestheentire ular,thequeryencodingandinteractioninColBERTconsumeonly\ncomputationfromgatheringthedocumentrepresentations,moving 13millisecondsofitstotalexecutiontime.WenotethatColBERT’s\nthemtotheGPU,tokenizingthenencodingthequery,andapplying latencyandFLOPscanbeconsiderablyreducedbypaddingqueries\nlateinteractiontocomputedocumentscores. Forthebaselines, toashorterlength,usingsmallervectordimensions(theMRR@10\nwemeasurethescoringcomputationsontheGPUandexclude ofwhichistestedin§4.5),employingquantizationofthedocument\nthe CPU-based text preprocessing (similar to [9]). In principle,\nthebaselinescanpre-computethemajorityofthispreprocessing\n(e.g.,documenttokenization)offlineandparallelizetherestacross 6https://github.com/mit-han-lab/torchprofile",
"vectors,andstoringtheembeddingsonGPUifsufficientmemory\nexists.Weleavethesedirectionsforfuturework.\n109\n108\n107\n106\n105\n104\n103\n0.27 0.29 0.31 0.33 0.35 0.37\nMRR@10\n)elacs-gol(\nsPOLF\nnoilliM\nhavebeentestedonthisdataset.Theseresultsdirectlymirrorthose\nwithMSMARCO.\n4.3 End-to-endTop-k Retrieval\nBERTbase (our training) Beyondcheapre-ranking,ColBERTisamenabletotop-kretrievaldi-\nColBERT 2000 rectlyfromafullcollection.Table2considersfullretrieval,wherein\n500\n1000 each model retrieves the top-1000 documents directly from MS\n100 50 200 MARCO’s8.8Mdocumentsperquery.InadditiontoMRR@10and\n20\nk=10 latencyinmilliseconds,thetablereportsRecall@50,Recall@200,\nandRecall@1000,importantmetricsforafull-retrievalmodelthat\nessentiallyfiltersdownalargecollectiononaper-querybasis.\nk=10 20 50 100 5002000\nWecompareagainstBM25,inparticularMSMARCO’sofficial\n200 1000\nBM25rankingaswellasawell-tunedbaselinebasedontheAnserini\ntoolkit.7 Whilemanyothertraditionalmodelsexist,wearenot\nawareofanythatsubstantiallyoutperformAnserini’sBM25im-\nFigure 4: FLOPs (in millions) and MRR@10 as functions plementation(e.g.,seeRM3in[28],LMDirin[2],orMicrosoft’s\nofthere-rankingdepthk. SincetheofficialBM25ranking proprietaryfeature-basedRankSVMontheleaderboard).\nisnotordered,theinitialtop-k retrievalisconductedwith Wealsocompareagainstdoc2query, DeepCT,anddocTTTT-\nAnserini’sBM25. Tquery. Allthreerelyonatraditionalbag-of-wordsmodel(pri-\nmarilyBM25)forretrieval.Crucially,however,theyre-weighthe\nDivingdeeperintothequality–costtradeoffbetweenBERTand frequencyoftermsperdocumentand/orexpandthesetofterms\nColBERT,Figure4demonstratestherelationshipsbetweenFLOPs ineachdocumentbeforebuildingtheBM25index. Inparticular,\nandeffectiveness(MRR@10)asafunctionofthere-rankingdepth doc2query expands each document with a pre-defined number\nkwhenre-rankingthetop-kresultsbyBM25,comparingColBERT of synthetic queries generated by a seq2seq transformer model\nandBERT base (ourtraining).WeconductthisexperimentonMS (whichdocTTTTqueryreplacedwithapre-trainedlanguagemodel,\nMARCO(Dev).Wenoteherethatastheofficialtop-1000ranking T5[31]).Incontrast,DeepCTusesBERTtoproducethetermfre-\ndoesnotprovidetheBM25order(andalsolacksdocumentsbeyond quencycomponentofBM25inacontext-awaremanner.\nthetop-1000perquery),themodelsinthisexperimentre-rankthe ForthelatencyofAnserini’sBM25,doc2query,anddocTTTT-\nAnserini[37]toolkit’sBM25output.Consequently,bothMRR@10 query,weusetheauthors’[26,28]Anserini-basedimplementation.\nvaluesatk =1000areslightlyhigherfromthosereportedinTable1. Whilethisimplementationsupportsmulti-threading,itonlyutilizes\nStudyingtheresultsinFigure4,wenoticethatnotonlyisCol- parallelismacrossdifferentqueries.Wethusreportsingle-threaded\nBERTmuchcheaperthanBERTforthesamemodelsize(i.e.,12- latency for these models, noting that simply parallelizing their\nlayer“base”transformerencoder), italsoscalesbetterwiththe computationovershardsoftheindexcansubstantiallydecrease\nnumberofrankeddocuments. Inpart,thisisbecauseColBERT theiralready-lowlatency.ForDeepCT,weonlyestimateitslatency\nonlyneedstoprocessthequeryonce,irrespectiveofthenumberof usingthatofBM25(asdenotedby(est.)inthetable),sinceDeepCT\ndocumentsevaluated.Forinstance,atk =10,BERTrequiresnearly re-weighsBM25’stermfrequencywithoutmodifyingtheindex\n180×moreFLOPsthanColBERT;atk = 1000,BERT’soverhead otherwise.8 Asdiscussedin§4.1,weuseColBERT forend-to-\nL2\njumpsto13,900×.Itthenreaches23,000×atk =2000.Infact,our endretrieval,whichemploysnegativesquaredL2distanceasits\ninformalexperimentationshowsthatthisorders-of-magnitudegap vector-similarityfunction.Foritslatency,wemeasurethetimefor\ninFLOPsmakesitpracticaltorunColBERTentirelyontheCPU, faiss-basedcandidatefilteringandthesubsequentre-ranking.In\nalthoughCPU-basedre-rankingliesoutsideourscope. thisexperiment,faissusesallavailableCPUcores.\nLookingatTable2,wefirstseeAnserini’sBM25baselineat18.7\nMethod MAP MRR@10 MRR@10,noticingitsverylowlatencyasimplementedinAnserini\n(whichextendsthewell-knownLucenesystem), owingtoboth\nBM25(Anserini) 15.3 -\ndoc2query 18.1 -\nverycheapoperationsanddecadesofbag-of-wordstop-kretrieval\nDeepCT 24.6 33.2 optimizations.Thethreesubsequentbaselines,namelydoc2query,\nDeepCT,anddocTTTTquery,eachbringsadecisiveenhancement\nBM25+BERT 31.0 -\nbase toeffectiveness.Theseimprovementscomeatnegligibleoverheads\nBM25+BERT 33.5 -\nlarge inlatency, sincethesebaselinesultimatelyrelyonBM25-based\nBM25+ColBERT 31.3 44.3 retrieval. Themosteffectiveamongthesethree,docTTTTquery,\nTable3:ResultsonTRECCAR. demonstratesamassive9%gainovervanillaBM25byfine-tuning\ntherecentlanguagemodelT5.\nHavingstudiedourresultsonMSMARCO,wenowconsider\nTRECCAR,whoseofficialmetricisMAP.Resultsaresummarized 7http://anserini.io/\ninTable3,whichincludesanumberofimportantbaselines(BM25,\n8Inpractice,amyriadofreasonscouldstillcauseDeepCT’slatencytodiffer\nslightlyfromBM25’s.Forinstance,thetop-kpruningstrategyemployed,ifany,could\ndoc2query,andDeepCT)inadditiontore-rankingbaselinesthat interactdifferentlywithachangeddistributionofscores.",
"ShiftingourattentiontoColBERT’send-to-endretrievaleffec-\nBasic ColBERT Indexing\ntiveness,weseeitsmajorgainsinMRR@10overalloftheseend-to-\n+multi-GPU document processing\nendmodels.Infact,usingColBERTintheend-to-endsetupissupe- +per-batch maximum sequence length\nriorintermsofMRR@10tore-rankingwiththesamemodeldue +length-based bucketing\ntotheimprovedrecall.MovingbeyondMRR@10,wealsoseelarge +multi-core pre-processing\ngainsinRecall@kforkequalsto50,200,and1000.Forinstance, 0 10000 20000 30000 40000 50000\nThroughput (documents/minute)\nitsRecall@50actuallyexceedstheofficialBM25’sRecall@1000and\nFigure6:EffectofColBERT’sindexingoptimizationsonthe\nevenallbutdocTTTTTquery’sRecall@200,emphasizingthevalue\nofflineindexingthroughput.\nofend-to-endretrieval(insteadofjustre-ranking)withColBERT.\n4.5 IndexingThroughput&Footprint\n4.4 AblationStudies\nLastly,weexaminetheindexingthroughputandspacefootprint\nofColBERT.Figure6reportsindexingthroughputonMSMARCO\ndocumentswithColBERTandfourotherablationsettings,which\nBERT [CLS]-based dot-product (5-layer) [A] individuallyenableoptimizationsdescribedin§3.4ontopofbasic\nColBERT via average similarity (5-layer) [B] batchedindexing.Basedonthesethroughputs,ColBERTcanindex\nColBERT without query augmentation (5-layer) [C] MSMARCOinaboutthreehours.NotethatanyBERT-basedmodel\nColBERT (5-layer) [D] mustincurthecomputationalcostofprocessingeachdocument\nColBERT (12-layer) [E]\natleastonce.WhileColBERTencodeseachdocumentwithBERT\nColBERT + e2e retrieval (12-layer) [F]\nexactlyonce,existingBERT-basedrankerswouldrepeatsimilar\n0.22 0.24 0.26 0.28 0.30 0.32 0.34 0.36\nMRR@10 computationsonpossiblyhundredsofdocumentsforeachquery.\nFigure 5: Ablation results on MS MARCO (Dev). Between\nbracketsisthenumberofBERTlayersusedineachmodel.\nSetting Dimension(m) Bytes/Dim Space(GiBs) MRR@10\nRe-rankCosine 128 4 286 34.9\nEnd-to-endL2 128 2 154 36.0\nTheresultsfrom§4.2indicatethatColBERTishighlyeffective\nRe-rankL2 128 2 143 34.8\ndespitethelowcostandsimplicityofitslateinteractionmechanism.\nRe-rankCosine 48 4 54 34.4\nTobetterunderstandthesourceofthiseffectiveness,weexaminea\nRe-rankCosine 24 2 27 33.9\nnumberofimportantdetailsinColBERT’sinteractionandencoder\nTable4:SpaceFootprintvsMRR@10(Dev)onMSMARCO.\narchitecture.Forthisablation,wereportMRR@10onthevalidation\nsetofMSMARCOinFigure5,whichshowsourmainre-ranking\nColBERTmodel[E],[email protected]%. Table4reportsthespacefootprintofColBERTundervarious\nDuetothecostoftrainingallmodels,wetrainacopyofour settingsaswereducetheembeddingsdimensionand/orthebytes\nmainmodelthatretainsonlythefirst5layersofBERToutof12 perdimension.Interestingly,themostspace-efficientsetting,that\n(i.e.,model[D])andsimilarlytrainallourablationmodelsfor200k is,re-rankingwithcosinesimilaritywith24-dimensionalvectors\niterationswithfiveBERTlayers.Tobeginwith,weaskifthefine- storedas2-bytefloats,isonly1%worseinMRR@10thanthemost\ngranular interaction in late interaction is necessary. Model [A] space-consumingone,whiletheformerrequiresonly27GiBsto\ntacklesthisquestion:itusesBERTtoproduceasingleembedding representtheMSMARCOcollection.\nvectorforthequeryandanotherforthedocument,extractedfrom\n5 CONCLUSIONS\nBERT’s[CLS]contextualizedembeddingandexpandedthrougha\nlinearlayertodimension4096(whichequalsNq ×128=32×128). Inthispaper,weintroducedColBERT,anovelrankingmodelthat\nRelevanceisestimatedastheinnerproductofthequery’sandthe employscontextualizedlateinteractionoverdeepLMs(inparticular,\ndocument’sembeddings,whichwefoundtoperformbetterthan BERT)forefficientretrieval.Byindependentlyencodingqueries\ncosinesimilarityforsingle-vectorre-ranking.Astheresultsshow, anddocumentsintofine-grainedrepresentationsthatinteractvia\nthismodelisconsiderablylesseffectivethanColBERT,reinforcing cheapandpruning-friendlycomputations,ColBERTcanleverage\ntheimportanceoflateinteraction. theexpressivenessofdeepLMswhilegreatlyspeedingupquery\nSubsequently,weaskifourMaxSim-basedlateinteractionisbet- processing.Inaddition,doingsoallowsusingColBERTforend-to-\nterthanothersimplealternatives.Wetestamodel[B]thatreplaces endneuralretrievaldirectlyfromalargedocumentcollection.Our\nColBERT’smaximumsimilaritywithaveragesimilarity.Theresults resultsshowthatColBERTismorethan170×fasterandrequires\nsuggesttheimportanceofindividualtermsinthequerypaying 14,000×fewerFLOPs/querythanexistingBERT-basedmodels,all\nspecialattentiontoparticulartermsinthedocument. Similarly, whileonlyminimallyimpactingqualityandwhileoutperforming\nthefigureemphasizestheimportanceofourqueryaugmentation everynon-BERTbaseline.\nmechanism:withoutqueryaugmentation[C],ColBERThasano- Acknowledgments.OKwassupportedbytheEltoukhyFamily\[email protected],weseetheimpactofend-to-end GraduateFellowshipattheStanfordSchoolofEngineering.This\nretrievalnotonlyonrecallbutalsoonMRR@10. Byretrieving research was supported in part by affiliate members and other\ndirectlyfromthefullcollection,ColBERTisabletoretrievetothe supportersoftheStanfordDAWNproject—AntFinancial,Facebook,\ntop-10documentsmissedentirelyfromBM25’stop-1000. Google,Infosys,NEC,andVMware—aswellasCisco,SAP,andthe",
"NSFunderCAREERgrantCNS-1651570.Anyopinions,findings, [25] RodrigoNogueiraandKyunghyunCho.2019.PassageRe-rankingwithBERT.\nandconclusionsorrecommendationsexpressedinthismaterialare arXivpreprintarXiv:1901.04085(2019).\n[26] RodrigoNogueira,JimmyLin,andAIEpistemic.2019. Fromdoc2queryto\nthoseoftheauthorsanddonotnecessarilyreflecttheviewsofthe\ndocTTTTTquery.(2019).\nNationalScienceFoundation. [27] RodrigoNogueira,WeiYang,KyunghyunCho,andJimmyLin.2019.Multi-Stage\nDocumentRankingwithBERT.arXivpreprintarXiv:1910.14424(2019).\nREFERENCES [28] RodrigoNogueira,WeiYang,JimmyLin,andKyunghyunCho.2019.Document\nExpansionbyQueryPrediction.arXivpreprintarXiv:1904.08375(2019).\n[1] FirasAbuzaid,GeetSethi,PeterBailis,andMateiZaharia.2019.ToIndexorNot [29] MatthewEPeters,MarkNeumann,MohitIyyer,MattGardner,Christopher\ntoIndex:OptimizingExactMaximumInnerProductSearch.In2019IEEE35th Clark,KentonLee,andLukeZettlemoyer.2018. Deepcontextualizedword\nInternationalConferenceonDataEngineering(ICDE).IEEE,1250–1261. representations.arXivpreprintarXiv:1802.05365(2018).\n[2] ZhuyunDaiandJamieCallan.2019. Context-AwareSentence/PassageTerm [30] YifanQiao,ChenyanXiong,ZhenghaoLiu,andZhiyuanLiu.2019. Under-\nImportanceEstimationForFirstStageRetrieval.arXivpreprintarXiv:1910.10687 standingtheBehaviorsofBERTinRanking. arXivpreprintarXiv:1904.07531\n(2019). (2019).\n[3] ZhuyunDaiandJamieCallan.2019. DeeperTextUnderstandingforIRwith [31] ColinRaffel,NoamShazeer,AdamRoberts,KatherineLee,SharanNarang,\nContextualNeuralLanguageModeling.arXivpreprintarXiv:1905.09217(2019). MichaelMatena,YanqiZhou,WeiLi,andPeterJLiu.2019. Exploringthe\n[4] ZhuyunDai,ChenyanXiong,JamieCallan,andZhiyuanLiu.2018.Convolutional limitsoftransferlearningwithaunifiedtext-to-texttransformer.arXivpreprint\nneuralnetworksforsoft-matchingn-gramsinad-hocsearch.InProceedingsofthe arXiv:1910.10683(2019).\neleventhACMinternationalconferenceonwebsearchanddatamining.126–134. [32] StephenERobertson,SteveWalker,SusanJones,MichelineMHancock-Beaulieu,\n[5] JacobDevlin,Ming-WeiChang,KentonLee,andKristinaToutanova.2018.Bert: MikeGatford,etal.1995.OkapiatTREC-3.NISTSpecialPublication(1995).\nPre-trainingofdeepbidirectionaltransformersforlanguageunderstanding. [33] RaphaelTang,YaoLu,LinqingLiu,LiliMou,OlgaVechtomova,andJimmyLin.\narXivpreprintarXiv:1810.04805(2018). 2019.Distillingtask-specificknowledgefromBERTintosimpleneuralnetworks.\n[6] LauraDietz,ManishaVerma,FilipRadlinski,andNickCraswell.2017. TREC arXivpreprintarXiv:1903.12136(2019).\nComplexAnswerRetrievalOverview..InTREC. [34] AshishVaswani,NoamShazeer,NikiParmar,JakobUszkoreit,LlionJones,\n[7] JiafengGuo,YixingFan,QingyaoAi,andWBruceCroft.2016.Adeeprelevance AidanNGomez, LukaszKaiser,andIlliaPolosukhin.2017. Attentionisall\nmatchingmodelforad-hocretrieval.InProceedingsofthe25thACMInternational youneed.InAdvancesinneuralinformationprocessingsystems.5998–6008.\nonConferenceonInformationandKnowledgeManagement.ACM,55–64. [35] YonghuiWu,MikeSchuster,ZhifengChen,QuocVLe,MohammadNorouzi,\n[8] JiafengGuo,YixingFan,LiangPang,LiuYang,QingyaoAi,HamedZamani, WolfgangMacherey,MaximKrikun,YuanCao,QinGao,KlausMacherey,etal.\nChenWu,WBruceCroft,andXueqiCheng.2019. Adeeplookintoneural 2016.Google’sneuralmachinetranslationsystem:Bridgingthegapbetween\nrankingmodelsforinformationretrieval.arXivpreprintarXiv:1903.06902(2019). humanandmachinetranslation.arXivpreprintarXiv:1609.08144(2016).\n[9] SebastianHofsta¨tterandAllanHanbury.2019.Let’smeasureruntime!Extending [36] ChenyanXiong,ZhuyunDai,JamieCallan,ZhiyuanLiu,andRussellPower.\ntheIRreplicabilityinfrastructuretoincludeperformanceaspects.arXivpreprint 2017. End-to-endneuralad-hocrankingwithkernelpooling.InProceedings\narXiv:1907.04614(2019). ofthe40thInternationalACMSIGIRconferenceonresearchanddevelopmentin\n[10] SebastianHofsta¨tter,NavidRekabsaz,CarstenEickhoff,andAllanHanbury. informationretrieval.55–64.\n2019.Ontheeffectoflow-frequencytermsonneural-IRmodels.InProceedings [37] PeilinYang,HuiFang,andJimmyLin.2018. Anserini:Reproducibleranking\nofthe42ndInternationalACMSIGIRConferenceonResearchandDevelopmentin baselinesusingLucene. JournalofDataandInformationQuality(JDIQ)10,4\nInformationRetrieval.1137–1140. (2018),1–20.\n[11] SebastianHofsta¨tter,MarkusZlabinger,andAllanHanbury.2019.TUWien@ [38] WeiYang,KuangLu,PeilinYang,andJimmyLin.2019.CriticallyExamining\nTRECDeepLearning’19–SimpleContextualizationforRe-ranking.arXivpreprint the”NeuralHype”WeakBaselinesandtheAdditivityofEffectivenessGains\narXiv:1912.01385(2019). fromNeuralRankingModels.InProceedingsofthe42ndInternationalACMSIGIR\n[12] Po-SenHuang,XiaodongHe,JianfengGao,LiDeng,AlexAcero,andLarry ConferenceonResearchandDevelopmentinInformationRetrieval.1129–1132.\nHeck.2013. Learningdeepstructuredsemanticmodelsforwebsearchusing [39] ZeynepAkkalyoncuYilmaz,WeiYang,HaotianZhang,andJimmyLin.2019.\nclickthroughdata.InProceedingsofthe22ndACMinternationalconferenceon Cross-domainmodelingofsentence-levelevidencefordocumentretrieval.In\nInformation&KnowledgeManagement.2333–2338. Proceedingsofthe2019ConferenceonEmpiricalMethodsinNaturalLanguagePro-\n[13] ShiyuJi,JinjinShao,andTaoYang.2019. EfficientInteraction-basedNeural cessingandthe9thInternationalJointConferenceonNaturalLanguageProcessing\nRankingwithLocalitySensitiveHashing.InTheWorldWideWebConference. (EMNLP-IJCNLP).3481–3487.\nACM,2858–2864. [40] OfirZafrir,GuyBoudoukh,PeterIzsak,andMosheWasserblat.2019.Q8bert:\n[14] XiaoqiJiao,YichunYin,LifengShang,XinJiang,XiaoChen,LinlinLi,FangWang, Quantized8bitbert.arXivpreprintarXiv:1910.06188(2019).\nandQunLiu.2019.Tinybert:Distillingbertfornaturallanguageunderstanding. [41] HamedZamani,MostafaDehghani,WBruceCroft,ErikLearned-Miller,and\narXivpreprintarXiv:1909.10351(2019). JaapKamps.2018.Fromneuralre-rankingtoneuralranking:Learningasparse\n[15] JeffJohnson,MatthijsDouze,andHerve´Je´gou.2017. Billion-scalesimilarity representationforinvertedindexing.InProceedingsofthe27thACMInternational\nsearchwithGPUs.arXivpreprintarXiv:1702.08734(2017). ConferenceonInformationandKnowledgeManagement.ACM,497–506.\n[16] DiederikPKingmaandJimmyBa.2014.Adam:Amethodforstochasticopti- [42] LeZhao.2012.Modelingandsolvingtermmismatchforfull-textretrieval.Ph.D.\nmization.arXivpreprintarXiv:1412.6980(2014). Dissertation.CarnegieMellonUniversity.\n[17] RonKohavi,AlexDeng,BrianFrasca,TobyWalker,YaXu,andNilsPohlmann.\n2013.Onlinecontrolledexperimentsatlargescale.InSIGKDD.\n[18] SeanMacAvaney,AndrewYates,ArmanCohan,andNazliGoharian.2019.Cedr:\nContextualizedembeddingsfordocumentranking.InProceedingsofthe42nd\nInternationalACMSIGIRConferenceonResearchandDevelopmentinInformation\nRetrieval.ACM,1101–1104.\n[19] PaulMichel,OmerLevy,andGrahamNeubig.2019.AreSixteenHeadsReally\nBetterthanOne?.InAdvancesinNeuralInformationProcessingSystems.14014–\n14024.\n[20] BhaskarMitraandNickCraswell.2019.AnUpdatedDuetModelforPassage\nRe-ranking.arXivpreprintarXiv:1903.07666(2019).\n[21] BhaskarMitra,NickCraswell,etal.2018.Anintroductiontoneuralinformation\nretrieval.FoundationsandTrends®inInformationRetrieval13,1(2018),1–126.\n[22] BhaskarMitra,FernandoDiaz,andNickCraswell.2017.Learningtomatchusing\nlocalanddistributedrepresentationsoftextforwebsearch.InProceedingsof\nthe26thInternationalConferenceonWorldWideWeb.InternationalWorldWide\nWebConferencesSteeringCommittee,1291–1299.\n[23] BhaskarMitra,CorbyRosset,DavidHawking,NickCraswell,FernandoDiaz,\nandEmineYilmaz.2019.Incorporatingquerytermindependenceassumption\nforefficientretrievalandrankingusingdeepneuralnetworks.arXivpreprint\narXiv:1907.03693(2019).\n[24] TriNguyen,MirRosenberg,XiaSong,JianfengGao,SaurabhTiwary,Rangan\nMajumder,andLiDeng.2016. MSMARCO:AHuman-GeneratedMAchine\nReadingCOmprehensionDataset.(2016)."
] |
|
[
"Apreprint\nDescription-Based Text Similarity\nShauliRavfogel1 ValentinaPyatkin1,2AmirDNCohen1 AvshalomManevich1 YoavGoldberg1,2\n1Bar-IlanUniversity 2AllenInstituteforArtificialIntelligence\n{shauli.ravfogel, valpyatkin, amirdnc, avshalomman, yoav.goldberg}@gmail.com\nAbstract\nIdentifyingtextswithagivensemanticsiscentralformanyinformation\nseekingscenarios. Similaritysearchovervectorembeddingsappeartobe\ncentraltothisability,yetthesimilarityreflectedincurrenttextembeddings\niscorpus-driven,andisinconsistentandsub-optimalformanyusecases.\nWhat,then,isagoodnotionofsimilarityforeffectiveretrievaloftext?\nWeidentifytheneedtosearchfortextsbasedonabstractdescriptionsof\ntheircontent,andthecorrespondingnotionofdescriptionbasedsimilarity.\nWedemonstratetheinadequacyofcurrenttextembeddingsandpropose\nanalternativemodelthatsignificantlyimproveswhenusedinstandard\nnearestneighborsearch. Themodelistrainedusingpositiveandnegative\npairssourcedthroughpromptingaLLM,demonstratinghowdatafrom\nLLMscanbeusedforcreatingnewcapabilitiesnotimmediatelypossible\nusingtheoriginalmodel.\nhttps://github.com/shauli-ravfogel/descriptions\nDataset;Model\n1 Introduction\nSearchingfortextsbasedontheirsemanticsisimportantforknowledgeseekingagents.\nSuchagentscanbehumanusers,orartificialones: eitherLLM-basedagentsthataretasked\nwith a complex goal and need to locate information as a sub-goal, or as components in\nretrievalaugmentedgeneration(Khandelwaletal.,2019;Guuetal.,2020;Parisietal.,2022).\nCurrent semantic search solutions are based on dense encoders (Reimers & Gurevych,\n2019;Gaoetal.,2021)whichlearnarepresentationspacesuchthat“similar”documents\nareproximateinspace. Thenotionofsimilarityinthiscontext,however,isnotexplicitly\ndefinedbutratherlearnedfromvastdatasetscontainingpairsoftextslabeledassimilar,\noftenmixingvariousdifferentkindsofsimilarity(Kasteretal.,2021;Opitz&Frank,2022).\nThismakesthemsub-optimalforinformationseekingqueries,asitishardtocontrolor\npredicttheresultsofagivensimilarity-basedquery. Whatisagoodqueryrepresentation\nandsimilaritydefinitionforasemantic-searchusecase?\nInthispaper,wesuggestaconsistentandwell-definedrelationbetweentexts,whichwe\nbelieve to be a useful one to encode as a vector-similarity metric: the relation between\nabstractdescriptionsofsentences,andtheirinstantiations. WhileLLMscanidentifyand\noperateonthisrelation,wefindthattherepresentationspacesthatemergeusingcommon\ntext-encodingtechniquesaresub-optimalforencodingitasasimilaritymetric. Weshow\nhowtoconstructbetterembeddingsforthispurpose. UsingLLMs,wecreateadatasetthat\ncapturesthisspecificnotionforsimilarity,anduseittotrainanencoderwhoserepresentation\nspacesuppressesstate-of-the-arttextencoderstrainedonordersofmagnitudemoredata.\nOur focus is in acommon kind of information need which is mostlyunachievable with\ncurrentsearchtechniques: retrievingtextsbasedonadescriptionofthecontentofthetext.\nFor example, in the domain of medical research, an agent might want to find sentences\ndiscussing the efficacy of a specific drug in treating a particular condition, such as “the\neffectivenessofdrugXinmanaginghypertension”. Ortheycangomoreabstract,andlook\nfor“substanceabuseinanimals”or“atransferofadiseasebetweentwospecies”. Outside\n1\n4202\nrpA\n52\n]LC.sc[\n3v71521.5032:viXra",
"Apreprint\nofthehardsciences,onemaywanttosearchthecorpusforsentencesrelatedtoahistorical\nevent,suchas“animportantbattlefoughtduringWorldWarII”or“asignificantscientific\ndiscoveryinthefieldofphysics”. Ininternationalrelationsresearchcontext,theagentmay\nwanttoscouracorpusfor“onecountrythreateningtheeconomyofanothercountry”,ina\ntradingcontextanagentmaysearchfor“atransactioninvolvingpreciousmetals”,anda\npop-culturejournalismanagentmaysearchtwitterfor“afightbetweentwocelebrities”.\nIn all these cases, the agent is not interested in a definition or a single answer, but in\nsentenceswhosecontentisaspecificinstantiationoftheirquery(forexample,“Thestudies\nhaveshownthatasub-populationofprimateschronicallyconsumeintoxicatingamountsof\nalcohol”forthe“substanceabuseinanimals”query). Inotherwords,weareinterestedina\nhigher-ordersimilarityreflectingthe“instance-of”property.\nFigure1: TopretrievalresultsfromtheWikipediaIndex. Ours: themodeldevelopedinthis\nwork. Existing: all-mpnet-base-v2,astrongsentence-similarityencoder.\nSuch retrieval cannot be easily achieved through keyword-based retrieval, because the\nretrievedtextismorespecificthanthedescription,causingverylowlexicaloverlap. Itis\nalsonoteasilyachievablebycurrent“denseretrieval”systemsthatrelyonvectorsimilarity:\ngeneric sentence similarity methods (Reimers & Gurevych, 2019; Gao et al., 2021) tend\ntoretrievetextsthataresimilartothedescription,ratherthaninstantiationsofit(e.g.,a\nquerylike“anarchitectdesigningabuilding”shouldreturnasentencelike“TheFallingwater,\naremarkablearchitecturalmasterpiecelocatedinruralsouthwesternPennsylvania,wasdesigned\nby Frank Lloyd Wright”” and not “The architect participates in developing the requirements\nthe client wants in the building.”, although the latter is more similar under conventional\nsentencesimilaritymodels). Similarly,systemsthataretrainedtoretrievepassagesthat\ncontainanswerstoquestions(trained,forexample,onSQuAD(Rajpurkaretal.,2016;2018)),\nbeyond being focused on questions rather than assertions, are also focused on specifics\nratherthanabstractsituations(questionsareoftheform“whendidColumbusdiscoverAmerica”\nandnot“adiscoveryonanewlandbyanexplorer”). Modelstrainedonlargedatafromsearch\nquery logs may be more diverse, but are generally not available outside of a few large\ntechnologycompanies. Wedonotfindanexistingsoltuionthatfitsourgoal(Section6).\nWeshowthatretrievalbasedondescriptionisachievable: giventrainingdataconsisting\nof<description, text>pairs,wecantrainadescriptionsencoderandatextencoderthat\nlearntorepresentitemssuchthatthedescriptionsandthetextstheydescribeareclosein\nembeddingspace(§4). Thesevectorencodingscanthenbeusedinastandardsimilarity-\nbasedretrievalsetting. Figure1showsfourqueriesthatdidnotappearinthetrainingdata,\nandtheirtop-4retrieveditems,overacorpusofalmost10Mwikipediasentences.\n2",
"Apreprint\nToobtainthetrainingdata(§3),weobservethatthereversedirectionoftheprocess,going\nfromatexttoitsdescription,isataskthatcanquiteeasilybeperformedeitherbycrowd-\nworkers,or,aswedointhiswork,bylargelanguagemodelssuchasGPT-3(Brownetal.,\n2020)andCodex(Chenetal.,2021). Wethususethedavinci-text-03modeltogenerate\ndescriptionsofsentencessampledfromWikipedia,andusetheresultasourtrainingcorpus.\nEachsentencecanaccommodatemanydifferentdescriptions,pertainingtodifferentaspects\nofthetext. Wethereforeproducefivedifferentdescriptionsforeachtext, inadditionto\nincorrectdescriptions,tobeusedasnegativeexamples. Wefindthemodelstrainedonthis\ndatatoexcelinbothhuman(Section5.1)andautomatic(Section5.2)evaluation.\n2 Description-basedSimilarity\nGeneralsimilaritymetricsindocumentretrievalcaptureabroadrangeoflexical,syntactic,\nandsemanticresemblancesandrelations,offeringafoundationalapproachtosimilarity\nassessmentacrossvarioustasks. However, theiroverarchingnatureoftencompromises\ntask-specificrelevanceandprecision. Incontrast,weproposeaspecificrelationthatwe\nwanttobereflectedbythesimilaritymetric–theabstractdescriptionrelation–whichexplicitly\nmodelstherelationbetweenhigh-leveldescriptivequeriesandconcreteinstanceswithin\ndocuments.\nWestartbydefiningtheabstractdescriptionrelation:\nDefinition1(TheAbstract-DescriptionRelation) Given two texts,1 T and D, we say that\n(T,D)satisfiestheabstractdescriptionrelationiff:\n1)Ddescribes2(someof)thecontentofT.\n2)DcontainslessinformationandislessspecificthanT.\nNotethatthisisamany-to-manyrelation,whichisnotreflexive,anti-symmetricandnon-\ntransitive. Theabstractdescriptionsrelationrelatesto,butisnotthesame,asothertext-based\nsemanticnotionssuchasparaphrases,entailmentsandsummaries. Inparticular,descriptions\narenotparaphrases,asparaphrasesaresymmetricandnonlossy. Thedescriptionrelation\nis also more specific than summaries or entailments: while many descriptions are also\nparticipatingintheentailmentandsummaryrelations,notallentailmentsorsummariesare\nabstractdescriptions. Onenotabledifferencefromsummariesisthatsummariesattemptto\ncapturethemaineventsofthetext,anddonotabstractoverit.\nExample Toillustratetheabstract-descriptionrelation,considerthefollowingtextandthe\nthreevaliddescriptionsofit(takenfromourdataset,Section3):\n• Text: “OnJuly2,concurrentwiththeBattleofGettysburginneighboringAdams\nCounty,CaptainUlricDahlgren’sFederalcavalrypatrolgallopedintoGreencastle’s\ntownsquare,wheretheysurprisedandcapturedseveralConfederatecavalrymen\ncarryingvitalcorrespondencefromRichmond.”\n• Description1: Militarypersonnelthwartinganenemy’sattempttoconveyvital\ndocuments.\n• Description2: Thedisruptionofacommunicationexchangeinaruralarea.\n• Description3: Adramatic,unexpectedeventoccurringinatownsquareduringa\nbattle.\nClearly,thedescriptionsarehighlyabstract,incontrasttoconventionalsummaryofthetext;\nandtheyomitsomekeydetails,suchasthecountryandexactconflictbeingdiscussed,or\neventhefacttheeventoccurredduringabattle(description2);thedate;andthespecific\nunitsbeinginvolved. Additionally,thesentence“ThetownofGreencastleexistedduringthe\nbattleofGettyburg”isentailedbythetext,butdoesnotdescribeit.SeeSection6foradditional\ndiscussionofrelationtopreviouswork.\n1Inthecurrentpaper,bothT and Daresentences,butthisnotpartofthedefinition: T canbe\nlonderorshorterthanasentence.\n2Wedonotformallydefinedescribesandbuildontheintuitive,Englishlanguagemeaningofthe\nterm.\n3",
"Apreprint\nUtility Wearguethatabstractdescriptionsprovideanaturalandefficientwaytoexpress\ninformation seeking needs: users can always describe the results they want in natural\nlanguage. Importantly,thesedescriptionsonlyneedtocoversomeofthecontent,notevery\naspect (as some may be irrelevant to the user). A military historian might want to find\ndramaticeventsduringabattle(description3)withoutspecifyingthetimeorlocation.\nSimilarity Existingtextencodersstrugglewiththisrelationbecausedescriptionshave\nlittle lexical overlap with the text and they all lack concrete details mentioned in the text.\nHowever,ifwecouldcreatearepresentationspacewherethetextisclosetoeachdescription,\nretrievalwouldbestraightforward. OurgoalistolearnembeddingfunctionsE andE for\nT D\ntextsanddescriptionssuchthatsim(E (T),E (D))correlateswiththeabstractdesciprion\nT D\nrelationbybeinghigherforTandDforwhichtherelationholdsthanforallotherpairs.\n3 ObtainingTrainingData\nWe use GPT-3 (text-davinci-003) to generate positive and misleading descriptions for\nsentences from the English Wikipedia dataset.3 For each sentence, we generate 5 valid\ndescriptionsand5misleadingdescriptions. Intotal,wegeneratedescriptionsfor165,960\nWikipediasentences. SeetheAppendixfortheexactpromptsweuse.\nGeneratingmoreabstractdescriptions Whilethedescriptionswegeneratedotendtobe\nabstract,toaugmentthedatasetwithdescriptionsofhigherabstraction,werandomlyselect\nasubsetofinstances,re-promptGPT3withthreeofthevaliddescriptionsitgenerated,and\naskittogenerateabstractversionsofthem(thispromptisanin-contextlearningone,the\nexactpromptappearsinAppendixA.1). Thisresultsin69,891additionaldescriptionsfor\n23,297sentences(14.3%ofthedata). Toillustratetheeffectofthisiterativegeneration,for\nthesentence“Civilwarresumed,thistimebetweenrevolutionaryarmiesthathadfoughtin\naunitedcausetooustHuertain1913–14.”,oneoftheoriginaldescriptionsgeneratedwas\n“Aconflictbetweenopposinggroupsarisingfromtheoverthrowingofapoliticalleader”,\nwhiletheiterativequeryresultedinthemoreabstractdescription“Conflictarosebetween\ntwosidesthathadpreviouslybeenallied.”.\nFinaldataset Table1showsseveralexamplesofthegenerateddata,includingtheoriginal\nsentence and pairs of valid and misleading descriptions. The generated data includes\na wide range of both positive and misleading descriptions that align with the original\nsentence and the abstract description. The positive descriptions accurately capture the\nmainmeaningandkeyconceptsofthesentence,whilethemisleadingdescriptionscontain\ninaccuraciesorirrelevantinformation. Wehaverandomlydividedthedatainto158,000\ntrain,5000developmentand2960testinstances,eachcomposedofasentence,5invalid\ndescriptionsand5-8validdescriptions. Wefoundthequalityofthegenerateddescriptions\nadequatefortraining, andformeasuringprogressduringiterativedevelopment, which\nwealsoconfirmedthroughahumanevaluation. Weshowed229validdescriptionsand\ncorresponding sentences to Turkers, asking them to rate on a scale of 4, how well the\nsentence fits the description. On average the instances were highly rated with a score\nof 3.69/4, which lies between The sentence covers most of the main points mentioned in the\ndescriptionandThesentencecoverseverythingmentionedinthedescription.\nHowever,someofthedescriptionsdonotadequatelycaptureourintendedspiritofabstract\ndescriptionsofsentencesthatreflectaninformationneed. Thus,forthepurposeofhuman-\nevaluationofquality(Section5),wemanuallycurateasubsetof201sentencedescriptions\nfromthetestset,whichwemanuallyverifiedtoreflectaclearinformationneedthatwould\nmakesensetoahuman. Thesewerecollectedbyconsultingonlythedescriptions,without\ntheassociatedsentencestheywerederivedfrom,oranymodelpredictionbasedonthem.\n3https://huggingface.co/datasets/wikipedia\n4",
"Apreprint\nSentence GoodDescriptions BadDescriptions\nInterceptedbyUniongunboats, over Alargegroupofpeopleovercom- A group of people being inter-\n300ofhismensucceededincrossing. ingachallenge. ceptedwhilecrossingadesert.\nDopamineconstitutesabout80%ofthe Aneurotransmitterfoundinthe Aneurotransmitterfoundinthe\ncatecholaminecontentinthebrain. braininhighconcentrations. stomachinhighconcentrations.\nIn December 2021, Kammeraad was Asportsperson’sinclusionina A soccer player selected for a\nnamedinPhilippines23-mansquadfor squadforachampionship. tournamentinthePhilippinesin\nthe 2020 AFF Championship held in 2021.\nSingapore.\nAroundthistime, MTVintroduceda A visual element was imple- MTV’suseofadynamicgraphic.\nstaticandsinglecolordigitalon-screen mentedtoenhancetheviewing\ngraphictobeshownduringallofits experience.\nprogramming.\nAtthesigning,heisquotedashaving A historical event where a sig- Ajokeabouttheconsequencesof\nrepliedtoacommentbyJohnHancock nificantfiguremadeacomment notworkingtogether.\nthattheymustallhangtogether:“Yes, aboutunity.\nwemust,indeed,allhangtogether,or\nmostassuredlyweshallallhangsepa-\nrately”.\nItwassaidthatDemocritus’sfatherwas Adescriptionofawealthyfam- A description of a famous\nfrom a noble family and so wealthy ily’sinvolvementinasignificant leader’sfamilybackground.\nthathereceivedXerxesonhismarch event.\nthroughAbdera.\nHeseltine favoured privatisation of Apoliticalparty’splantoreverse Theeffectsofprivatisationonthe\nstateownedindustries,anovelideain apreviousgovernment’spolicy. economy.\n1979astheConservativeswereinitially\nonlyproposingtodenationalisethein-\ndustriesnationalisedbyLabourinthe\n1970s\nTable1: Examplesofgenerateddatatrainingdata,includingtheoriginalsentence,thegood\nandbaddescriptions\n4 EncoderTraining\nInordertotrainourmodelforthetaskofaligningsentenceswiththeirdescriptions,we\nutilizeapretrainedsentenceembeddingmodelandfine-tuneitwithcontrastivelearning.\nDuringthetrainingprocess,werepresenteachsentenceanditscorrespondingvaliddescrip-\ntionsusingtwodistinctinstancesofthemodel: oneasasentenceencoderandtheotherasa\ndescriptionencoder.\nLetSrepresentasetofsentences,P representthesetofvaliddescriptionsassociatedwith\ns\na sentence s, and N represent the set of negative descriptions for that same sentence s.\ns\nWeencodeeachsentenceanddescriptionviaamodel,resultinginavectorrepresentation\nforeachtoken. Weusemeanpoolingoverthetokenvectorsofeachofthesentenceand\ndescriptionpairstoobtainvectorrepresentationsinRd. Specifically,wedenotethevector\nrepresentationofasentencesasv ,thevectorrepresentationofavaliddescriptionofitas\ns\nv ,andthevectorrepresentationofanegativedescriptionasv .\np n\nTotraintheencoder,wecombinetwolossfunctions: thetripletloss(Chechiketal.,2010)\nandtheInfoNCEloss(vandenOordetal.,2018).\nThetripletloss,denotedasL (s),iscalculatedforeachsentencesasfollows:\ntriplet\n∑ max(0,m+∥v −v ∥2−∥v −v ∥2) (1)\ns p s n\n(p,n)∼Ps ×Ns\nHere,mrepresentsthemarginparameterthatdefinestheminimumdistancebetweenthe\npositiveandnegativedescriptions. Wetakem =1. Thislossencouragestherepresentation\nofeachsentencetobeclosertoitsvaliddescriptionsthantoitsinvaliddescriptions.\nTheInfoNCEloss, denotedas L (s), iscomputedusingarandomcollectionofin-\nInfoNCE\nbatchnegatives(i.e.,validdescriptionsofothersentencesinthebatch,aswellassentences\nthatcorrespondtothosedescriptions). Let N′ representthesetofallin-batchnegatives\ns\nsampled from the valid descriptions of other sentences within the batch, including the\n5",
"Apreprint\nsentencesthemselves. TheInfoNCElossisgivenby:\n(cid:32)\nexp(\nvs ·vp) (cid:33)\n−log τ (2)\nexp( vs\nτ\n·vp)+∑\nn′∈Ns\n′exp(vs ·\nτ\nv n′)\nWhere·iscosinesimilarityandτisthetemperature(wetakeτ =0.1).\nThefinallossusedfortrainingisacombinationofthetripletlossandascaledversionofthe\nInfoNCEloss:\nLoss(s) = L (s)+αL (s) (3)\ntriplet InfoNCE\nWetakeα =0.1. Anablationstudyrevealedamodestimprovementwhenusingthecom-\nbinedlosscomparedtousingonlythetripletcomponentoronlytheInfo-NCEcomponent\n(AppendixA.5). Wetrainfor30epochswithabatchsizeof128andoptimizeusingAdam\n(Kingma&Ba,2015).\n5 Evaluation\nTraditionalinformationretrieval(IR)benchmarksdonotalignwithourfocusonabstract\nsemanticsimilarity,matchinggeneralizeddescriptionswithexplicit,concreteinstances. As\nsuch,weconstructasetoftestqueries,andquantitativelyevaluateourmodelintwoways.\nWeperformhumanevaluationontheresultsretrievedfromalargecorpus(Section5.1).\nAdditionally, we perform automatic evaluation on an adversarially-constructed set of\nrelevantandirrelevantsentencesforthetestqueries(Section5.2),totesttherobustnessof\nourmodel. Weattachthetrainingandtestsets,alongsidethecode,inthesupplementary\nmaterial.\nSettingWesampleasetof10millionWikipediasentences(inadditiontothesetusedfor\ntraining and evaluation). We filter sentences shorter than 6 words, leaving a set of 9.55\nmillionsentences. Weencodethemusingthetrainedsentenceencoder,resultinginanindex\ncalledtheWikipediaIndexhenceforth. Thisisthesetfromwhichweretrieveinevaluation.\nGivenaqueryq,werepresentitwiththequeryencoderandperformexactnearest-neighbor\nsearchundercosinedistance.\nEvaluationset Wechosearandomsetof201descriptionsfromthetestset,whichweman-\nuallyverifiedtobereasonabledescription-queriesapersonmaybeinterestedin. Wethen\nperformedcrowd-sourcedevaluationofretrievalbasedonthesedescriptions,comparing\nourabstract-similaritymodeltoeachofthebaselinemodels.\nBaselines Weevaluateourmodelagainststrongsentenceencodermodelsbasedonthe\nMTEB (Muennighoff et al., 2022) leaderboard in the Sentence-Transformer framework\n(Reimers&Gurevych,2020),4all-mpnet-base-v2,E5-base(Wangetal.,2022),Instructor\n(Su et al., 2022), GTE-large Li et al. (2023), EmBER-v1 5, BGE-en Xiao et al. (2023), and\ncontrieverIzacardetal.(2021)6. Allmodelswerefinetunedbytheircreatorsondiverse\nsentence-similaritydatasets,containingordersofmagnitudemoredatathanours. Beyond\nthe Sentence-Transformer models, our study incorporates 3 additional baselines: BM25,\nHyDEandaSNLI-basedmodel(Bowmanetal.,2015b). BM25(Robertsonetal.,1995)uses\ntermfrequencyanddocumentlengthtoestimateadocument’srelevancetoaspecificquery.\nBM25hasbeenshowntobeastrongbaselinefordocumentretrieval(Izacardetal.,2022).\nHyDE(Gaoetal.,2022)isazero-shotmodelusingGPT-3togeneratesyntheticdocuments\nforagivenquery. Thedenserepresentationsofthesedocumentsareaveragedandfedasa\nquerytoapretraineddocumentretriever.7 Duetothesimilaritybetweendescriptionsand\n4https://huggingface.co/sentence-transformers\n5https://huggingface.co/llmrails/ember-v1\n6GTE,EmBERandBGEarethestate-of-the-artinthetimeofthewritingasperthebenchmark,\nwhiletheothermodelsarehighlypopular.\n7NotethatHyDEisdifferentthanourmodelandtheotherbaselinesinthesensethatitcallsthe\nGPT-3APIonceperqueryatinferencetime.\n6",
"Apreprint\nentailments,wealsofinetuneaMPnet-basedmodelforretrievalontheSNLIdataset. See\nAppendixA.2fordetailsonourbaselines.\nOurmodel,denotedasAbstract-sim,isafine-tunedversionofthepretrainedMPnetmodel\n(Songetal.,2020). Wedonotuseall-mpnet-base-v2,whichwasfurtherfinetunedonsimi-\nlaritydatasets,asityieldedworseresultsinpreliminaryexperiments. Fig.1showsthetop\nresultsoffourqueries,alongsidethetopresultsfromall-mpnet-base-v2forcomparison.\n5.1 HumanEvaluation\nWeperformhumanevaluationovernaturallyoccurringsentences,inanaturalretrieval\nscenario,whereabstractdescriptionsarelikelytobeusedasqueries. Thehumanevaluation\ncomparesthetopsentencesretrievedwithourmethod,andtothetopsentencesretrieved\nwiththestate-of-the-artsemanticsentenceencodingmodels.8\nThe evaluation setup is structured as follows.9 Crowdworkers are shown a query and\nresultsfromsearchovertheWikipediaIndex. Particularly,theyareshown10sentences,5\nofwhicharethetop-5retrievedsentencesfromabstract-simand5ofwhicharethetop-5\nretrievedsentencesfromoneofthebaseline(eachexperimentwithanotherbaseline). The\n10sentencesarerandomlyshuffled,andcrowdworkersarethenaskedtoselectallsentences\nthattheydeemareasonablefitforthequery. Eachtaskisshowntothreedistinctannotators.\nWeaimedatpayingcrowdworkers$15perhouronaverage. Eachqueryinstanceisshown\nto3annotators.\nMetrics We report the average number of results from each model that were selected\nas relevant (as a histogram), as well as the mean number of times a specific number of\nsentencesfromagivenmodelwaschosen(themeanofthehistogram).\n100\n80\n60\n40\n20\n0\n0 1 2 3 4 5\nNumber of sentences chosen\nstnuoC\nAbstract-sim (Ours)\nMPNet\nModel #chosen\nE5 abstract-sim 3.89±0.073/5\nHyDe\nHyDE 2.2/5 Instructor\nall-mpnet-base-v2 1.89/5\nInstructor-large 1.64/5\nE5-base 1.61/5\nTable 2: Human evaluation results (Sec-\ntion 5.1): number of sentences that crowd-\nworkersdeemedtobefittingthequery,from\na set of 5 retrieved sentences: Our model\nFigure2: Humanevaluationresults(Sec- (abstract-sim)vs. thefourbaselines. Thenum-\ntion5.1): numberoftimesagivennum-\nberreportedforabstract-simisamean±std\nber of sentences was chosen per query overthebinarycomparisonsagainsteachof\ninstance: Ourmodel(abstract-sim),aver- the4baselines.\naged over all 4 baseline evaluations, vs.\nthebaselines.\nResults Forevaluationweonlycountsentencestohavebeenselectedasrelevant,ifthey\nwere chosen by at least 2 out of 3 annotators. In Table 2 we show the average number\nofvalidretrievedsentencespermethod. Theannotatorshavechosensignificantlymore\nsentencesfromourabstract-simmodelcomparedtoall4baselines,withourmodelhaving\ncloseto4outof5sentencesdeemedasfittingthequeryonaverageandthebaselinemodels\nbetween1.61-2.2sentences. Fig.2showsthecompletedistributionofthenumberoftimesa\ngivennumberofsentenceswaschosenfromagivenmodel(wherethemaximumis5,thatis,\n8We do not compare against NLI and BM-25 due to their very low precision and recall in the\nautomaticevaluation(Section5.2;AppendixA.4)andFig.4.Additionally,duetobudgetconstraints,\nweonlycompareagainstthetop-3denseretreievalaspertheautomaticevaluation:E5,MPnetand\nInstructor.\n9ScreenshotsoftheannotationinterfacecanbefoundintheAppendix.\n7",
"Apreprint\nallthe5resultsforthemodelwerechosen). Notably,in99/201ofthetestcases,5sentences\nwerechosenfromabstract-sim’sresults;fromthebaselinesall5sentencewereonlychosen\nbetween14-28times. Thatis,inmanyofthecasesalltopresultswereconsideredasrelevant\nforthequery. Conversely,thebaselinesshowalargenumberofcaseswhereonly0,1,or\n2sentenceswherechosen,whilethesecasesaremuchrareramongabstract-simresults\n(below5vs. atleast42forthecaseof0relevantsentences). Overall,humaninspectionof\ntop-retrievedresultsshowalargepreferenceforourmodelscomparedwiththebaselines.\n5.2 AutomaticEvaluation\nWeaccompanythehumanevaluationwithamanually-constructedautomaticevaluation\ndataset,focusedonrobustnesstomisleadingresults. Wedonotknowhowmanyrelevant\nsentencesexistintheWikipediaindexforeachquery(ifany). Toallowforanautomatic\nevaluationinthefaceofthischallenge,weusethefollowingevaluationscheme. Weused\nGPTtogenerateasetofvalidsentencesperdescription. Totestrobustness,weworkunder\nan adversarial setting, where for each query we generate both relevant sentences and\ndistractingsentences. Wemeasuretheprecisionandrecallofourmodelandthebaselines\nmentionedabove.\nGeneratingsentencesfromdescriptionsWestartwiththe201valid,manually-verified\ndescriptions in the test set. We use GPT for the reverse task of our main task: mapping\nabstract descriptions to concrete sentences. We randomly choose one negative (invalid)\ndescriptionfromtheentryinthetestsetthatcorrespondstoeachvaliddescription. We\nmanuallyverifythatthechosendescriptionisindeedtopicallysimilarbutinvalid. Incase\nthe description does not contradict the valid description, we manually change it. The\nprocessresultsinacomplementarysetof201invalidabstractdescriptions. Forexample,\nforthevalidtestexample“Theexistenceofariverandatownwiththesamename”,we\nhavetheinvaliddescription“Theexistenceofariverandacountywiththesamename”.\nForboththevalidandinvaliddescriptions,wegenerateasetof12sentencesthatmatch\nthegivendescriptions,endingupwith12sentencesthatalignwithadescription,and12\nsentencesthatalignwithacontradictingdescription,thatservesasadistractor. These24\nsentenceswerethencombinedwiththeremaining9.55millionsentencesintheWikipedia\nIndex. ThepromptusedtogeneratethesesentencesisavailableinAppendixA.1.1. Weuse\nMturktoverifythevalidityoftheresultingsetofsentences.10 Theprocessresultsinan\naverageof11.2validsentencesand9.3invalidsentencespertestquery. SeeAppendixA.3\nforasample.\n1.0\n0.9\n0.8\n0.7\n0.6\n0.5\n0.4\n0.3\n0.2\n0.1\n0.0\n2 4 6 8 10 12\nk\nk@noisicerP\nMPnet\nInstructor\nE5\nSNLI\nHyDE\nBM25\nAbstract-sim (ours)\nContriver\nGTE\nBGE\nEmber\nFigure 3: Precision automatic evaluation results (Section 5.2): precision@k curve for\nabstract-simandthebaselines. Verticallinesrepresents1standarddeviation.\n10Forthesetofvalidsentenceswefilteroutallsentenceschosenasfittingthedescriptionbyatleast\ntwoannotators,Forthesetofinvalidsentenceswetakeallsentenceschosenasnottobeasuitablefit\nforthedescriptionbyatleasttwoannotators.\n8",
"Apreprint\nSetting Wefollow3metrics: valid-recall@k,invalid-recall@kandprecision@k. valid-recall@k\nmeasuresthenumberofvalidsentencescapturedwithinthefirstkretrievalresultsover\ntheWikipediaindex. Similarly,invalid-recall@kmeasuresthenumberofinvalidsentences\ncaptured. Finally,precision@kiscalculatedonlywithrespecttovalidandinvalidsentences\n(excluding the Wikipedia index, which might contain many more valid sentences): we\ncalculatethesimilarityofthedescriptiontothevalidandinvalidsentences,andcountthe\nnumberofvalidsentenceswithinthetopkresults.\nResults TheprecisionresultsareshowninAppendixA.4andtherecallresultsareshown\ninAppendixA.5. Ourmodelsimprovesoverallbaselinesintermsofprecision@k. Thegap\nislargestforprecision@1,andgraduallydecreases. Ourmodelachievesprecision@1=85.4%,\ncomparedwith73.6%forthestrongestbaseline,E5,correspondingto31/201vs. 53/201\nerrorsinthehighestrankedresult,respectively. Thegapdecreaseswithincreasingk(note\nthat we have a maximum of 12 positive examples). As for recall, generally models that\nachievehighvalid-recall@kalsoachievehighinvalid-recall@k. Ourmodelachievesrelatively\nlow valid-recall@k, but is better than all models in terms of invalid-recall@k (except SNLI,\nwhich has both low valid recall and low invalid recall), i.e., it tends to avoid returning\ninvalidsentences,atthepriceofmissingsomevalidones.\n6 Description-basedSimilarityvs. PreviousWork\nWecomparedescription-basedsimilaritywithpopularexistingsimilarity-basedretrieval\nmethods.\nVs. DenseSimilarityRetrieval: Thisfamilyofmethods,exemplifiedbySBERT(Reimers&\nGurevych,2019)encodessentencesbasedonanobjectivethatencouragessentenceswith\n“similarmeaning”tohavehighsimilarity. Similarmeaning,here,isdeterminedbymultiple\ncorpora such as Reddit comments (Henderson et al., 2019), SentEval (Conneau & Kiela,\n2018)andSNLI(Bowmanetal.,2015a). Assuch,thetypeofsimilaritycapturedbysuch\nmodelsinpracticeemergesfromthetrainingcorpus(Kasteretal.,2021;Opitz&Frank,\n2022)andisnotwellunderstood. Ourgoalisasimilaritymetricforthespecifictypeof\nrelationwedefine,betweenabstractdescriptionsandconcreteinstantiationsofthem.\nVs. QA-trainedDenseRetrieval:Thesesystemsaretrainedtoretrieveparagraphsbasedon\naquestion,inanopen-QAsetting(Karpukhinetal.,2020)Theretrievedparagraphsarethen\nrunthroughareadercomponent,whichattemptstoextracttheanswerfromeachretrieved\nparagraph. Thetrainingobjectiveistoencodeparagraphstobesimilartothequestionsto\nwhichtheycontainananswer. Questioncouldbeseenassimilartodescriptions(e.g. “early\nalbumsofmetalbands”canbeservedbyretrievingfor“whichmetalbandsreleasedan\nearlyalbum”),buttheyalsodifferinthat: (a)itisoftencumbersomeforausertorephrase\ntheinformationneedasaquestion—intheaboveexample,themovetoquestionformisnot\ntrivial;(b)questionsareoftenfocusedonasingleentitythatistheanswertothequestion,\nratherthenonasituationinvolvingarelationorinteractionbetweenseveralentities;(c)\nthekindsofquestionsincurrentQAtrainingsetstendtoaskaboutspecific,ratherthan\nabstract,cases,e.g. asking“whichmetalbandreleasedalbumPainkiller?” or“whatisthe\nfirstalbumbyMetallica?”.\nVs. Entailment/NLI <description, text>pairsadheretotheentailmentrelationbe-\ntweenpositive<hypothesis,text>pairsintheTextualInferencetask(Daganetal.,2005;\nBowmanetal.,2015a),whichisasupersetofthe<description,text>relation. Intheory,\nNLIbasedsimilaritymodelscouldperformwellonthistask. However,inpracticetheydo\nnotperformwell,possiblyduetothecompositionofexistingNLIdatasets. Additionally,\nthedonotusuallyencodethehypothesisandthepremiseindependently,makingefficient\nindexingdifficult.\n7 Conclusions\nWeintroducethetaskofsentenceretrievalbasedonabstractdescriptions. Weshowthat\ncurrentsentence-embeddingmethodsarenotagoodfitforthetask. WeleverageGPT-3\n9",
"Apreprint\nto generate a set of diverse valid and invalid abstract descriptions, and train a retrieval\nmodelonthatresultingdata. Wefindthatthemodeltrainedonthedatathatistailoredto\nthistaskisperformingsignificantlybetterthanstandardsentence-similaritymodels. This\ndisparityhighlightsthatthenotionofsimilaritycapturedbysentencetransformersisvague,\nandthattailoringittospecificinformationseekingneedmayresultinsignificantpractical\nimprovements.\nEthicsStatement\nAsalllanguagetechnology,themodelsanddataareinherentlydualuse—theycanbeused\nbothforgood(e.g.,toadvancehumanknowledge)orforbad(e.g.,forsurveillancethatis\naimedatdepressionofminoritycommunities). Wehopethatthebenefitsoutweighsthe\nrisksinourcase.\nAccordingtotheterms-of-serviceoftheGPTAPI,theAPIoutput(thecollecteddataand\nthemodelswecreatedbasedonit)shouldnotbeusedtocompetewithOpenAI.Wedeclare\nwehavenosuchintentions,andasktheusersofthedataandmodelstoalsorefrainfrom\ndoingso.\nReproducibilityStatement\nThetrainingandtestdata,aswellthecodeandthetrainedmodel,arepubliclyavailable.11\nReferences\nSamuelBowman,GaborAngeli,ChristopherPotts,andChristopherDManning. Alarge\nannotated corpus for learning natural language inference. In Proceedings of the 2015\nConferenceonEmpiricalMethodsinNaturalLanguageProcessing,pp.632–642,2015a.\nSamuel R. Bowman, Gabor Angeli, Christopher Potts, and Christopher D. Manning. A\nlargeannotatedcorpusforlearningnaturallanguageinference. InConferenceonEmpirical\nMethodsinNaturalLanguageProcessing,2015b.\nTom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla\nDhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al.\nLanguagemodelsarefew-shotlearners. Advancesinneuralinformationprocessingsystems,\n33:1877–1901,2020.\nGalChechik,VarunSharma,UriShalit,andSamyBengio. Largescaleonlinelearningof\nimagesimilaritythroughranking. JournalofMachineLearningResearch,11(3),2010.\nMarkChen,JerryTworek,HeewooJun,QimingYuan,HenriquePondedeOliveiraPinto,\nJaredKaplan,HarriEdwards,YuriBurda,NicholasJoseph,GregBrockman,etal. Evalu-\natinglargelanguagemodelstrainedoncode. arXivpreprintarXiv:2107.03374,2021.\nAlexisConneauandDouweKiela. Senteval: Anevaluationtoolkitforuniversalsentence\nrepresentations. InProceedingsoftheEleventhInternationalConferenceonLanguageResources\nandEvaluation(LREC2018),2018.\nIdo Dagan, Oren Glickman, and Bernardo Magnini. The pascal recognising textual en-\ntailmentchallenge. InProceedingsoftheFirstinternationalconferenceonMachineLearning\nChallenges: evaluating Predictive Uncertainty Visual Object Classification, and Recognizing\nTextualEntailment,pp.177–190,2005.\nLuyuGao,XueguangMa,JimmyLin,andJamieCallan. Precisezero-shotdenseretrieval\nwithoutrelevancelabels,2022.\n11 https://github.com/shauli-ravfogel/descriptions\nDataset;Model\n10",
"Apreprint\nTianyu Gao, Xingcheng Yao, and Danqi Chen. Simcse: Simple contrastive learning of\nsentenceembeddings. InProceedingsofthe2021ConferenceonEmpiricalMethodsinNatural\nLanguageProcessing,pp.6894–6910,2021.\nKelvinGuu,KentonLee,ZoraTung,PanupongPasupat,andMingweiChang. Retrieval\naugmentedlanguagemodelpre-training. InInternationalconferenceonmachinelearning,\npp.3929–3938.PMLR,2020.\nMatthewHenderson,PawełBudzianowski,In˜igoCasanueva,SamCoope,DanielaGerz,\nGirishKumar, NikolaMrksˇic, GeorgiosSpithourakis, Pei-HaoSu, IvanVulic, etal. A\nrepositoryofconversationaldatasets. ACL2019,pp. 1,2019.\nGautierIzacard,MathildeCaron,LucasHosseini,SebastianRiedel,PiotrBojanowski,Ar-\nmandJoulin,andEdouardGrave. Towardsunsuperviseddenseinformationretrieval\nwithcontrastivelearning. arXivpreprintarXiv:2112.09118,2(3),2021.\nGautierIzacard,MathildeCaron,LucasHosseini,SebastianRiedel,PiotrBojanowski,Ar-\nmandJoulin,andEdouardGrave. Unsuperviseddenseinformationretrievalwithcon-\ntrastivelearning,2022.\nVladimirKarpukhin,BarlasOguz,SewonMin,PatrickLewis,LedellWu,SergeyEdunov,\nDanqiChen,andWen-tauYih. Densepassageretrievalforopen-domainquestionan-\nswering. InProceedingsofthe2020ConferenceonEmpiricalMethodsinNaturalLanguage\nProcessing(EMNLP),pp.6769–6781,Online,November2020.AssociationforComputa-\ntionalLinguistics. doi: 10.18653/v1/2020.emnlp-main.550. URLhttps://aclanthology.\norg/2020.emnlp-main.550.\nMarvinKaster,WeiZhao,andSteffenEger. Globalexplainabilityofbert-basedevaluation\nmetricsbydisentanglingalonglinguisticfactors. InProceedingsofthe2021Conferenceon\nEmpiricalMethodsinNaturalLanguageProcessing,pp.8912–8925,2021.\nUrvashiKhandelwal,OmerLevy,DanJurafsky,LukeZettlemoyer,andMikeLewis. Gen-\neralizationthroughmemorization: Nearestneighborlanguagemodels. arXivpreprint\narXiv:1911.00172,2019.\nDiederikP.KingmaandJimmyBa. Adam: Amethodforstochasticoptimization. InYoshua\nBengioandYannLeCun(eds.), 3rdInternationalConferenceonLearningRepresentations,\nICLR2015,SanDiego,CA,USA,May7-9,2015,ConferenceTrackProceedings,2015. URL\nhttp://arxiv.org/abs/1412.6980.\nZehanLi,XinZhang,YanzhaoZhang,DingkunLong,PengjunXie,andMeishanZhang.\nTowardsgeneraltextembeddingswithmulti-stagecontrastivelearning. arXivpreprint\narXiv:2308.03281,2023.\nNiklasMuennighoff,NouamaneTazi,Lo¨ıcMagne,andNilsReimers. Mteb: Massivetext\nembeddingbenchmark. arXivpreprintarXiv:2210.07316,2022.\nJuriOpitzandAnetteFrank. Sbertstudiesmeaningrepresentations: Decomposingsentence\nembeddingsintoexplainablesemanticfeatures. InProceedingsofthe2ndConferenceofthe\nAsia-PacificChapteroftheAssociationforComputationalLinguisticsandthe12thInternational\nJointConferenceonNaturalLanguageProcessing,pp.625–638,2022.\nAaronParisi,YaoZhao,andNoahFiedel. Talm: Toolaugmentedlanguagemodels. arXiv\npreprintarXiv:2205.12255,2022.\nPranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. Squad: 100,000+\nquestions for machine comprehension of text. In Proceedings of the 2016 Conference on\nEmpiricalMethodsinNaturalLanguageProcessing,pp.2383–2392,2016.\nPranavRajpurkar, RobinJia, andPercyLiang. Knowwhatyoudon’tknow: Unanswer-\nablequestionsforsquad. InProceedingsofthe56thAnnualMeetingoftheAssociationfor\nComputationalLinguistics(Volume2: ShortPapers),pp.784–789,2018.\n11",
"Apreprint\nNilsReimersandIrynaGurevych. Sentence-bert: Sentenceembeddingsusingsiamesebert-\nnetworks. InProceedingsofthe2019ConferenceonEmpiricalMethodsinNaturalLanguage\nProcessingandthe9thInternationalJointConferenceonNaturalLanguageProcessing(EMNLP-\nIJCNLP),pp.3982–3992,2019.\nNilsReimersandIrynaGurevych. Makingmonolingualsentenceembeddingsmultilingual\nusingknowledgedistillation. InProceedingsofthe2020ConferenceonEmpiricalMethods\ninNaturalLanguageProcessing.AssociationforComputationalLinguistics,112020. URL\nhttps://arxiv.org/abs/2004.09813.\nStephenRobertson,S.Walker,S.Jones,M.M.Hancock-Beaulieu,andM.Gatford. Okapiat\ntrec-3. InOverviewoftheThirdTextREtrievalConference(TREC-3),pp.109–126.Gaithers-\nburg, MD: NIST, January 1995. URL https://www.microsoft.com/en-us/research/\npublication/okapi-at-trec-3/.\nKaitaoSong,XuTan,TaoQin,JianfengLu,andTie-YanLiu. Mpnet: Maskedandpermuted\npre-trainingforlanguageunderstanding.AdvancesinNeuralInformationProcessingSystems,\n33:16857–16867,2020.\nHongjinSu,JungoKasai,YizhongWang,YushiHu,MariOstendorf,Wen-tauYih,NoahA\nSmith,LukeZettlemoyer,TaoYu,etal. Oneembedder,anytask: Instruction-finetuned\ntextembeddings. arXivpreprintarXiv:2212.09741,2022.\nAa¨ronvandenOord,YazheLi,andOriolVinyals. Representationlearningwithcontrastive\npredictivecoding. CoRR,abs/1807.03748,2018. URLhttp://arxiv.org/abs/1807.03748.\nLiangWang,NanYang,XiaolongHuang,BinxingJiao,LinjunYang,DaxinJiang,Rangan\nMajumder,andFuruWei.Textembeddingsbyweakly-supervisedcontrastivepre-training.\narXivpreprintarXiv:2212.03533,2022.\nShitao Xiao, Zheng Liu, Peitian Zhang, and Niklas Muennighoff. C-pack: Packaged re-\nsourcestoadvancegeneralchineseembedding,2023.\n12",
"Apreprint\nA Appendix\nLimitations\nOurtrainingdata,modelsandexperimentareallstrictlyEnglish-based. Moreimportantly,\nwe observed the following limitation of the resulting similarity model. While it clearly\nisbetterthanallexistingmodelswecomparedagainstatidentifyingsentencesgivenan\nabstractdescription,wealsoobservedtheoppositetendency: forsomequeries,itisnot\nfaithfultotheprovideddescription. Forexample,searchingforthequery“Thedebutnovel\nof a french author” returns results such as “Euge´nie Grandet is a novel first published\nin 1833 by French author Honore´ de Balzac” or “Lanzarote (novel), a novel by Michel\nHouellebecq”,eithermentioningthefirsttimethenovelwaspublished,insteadofreturning\nmentionsofafirstnovelpublishedbyanauthor;ormentioningnovelswrittenbyFrench\nauthors,regardlessofwhetherornottheyaretheirdebutnovels.\nA.1 Prompting\nThesearethepromptsweusedtogeneratethesentencedescriptionsdataset. The“main\nprompt”wasusedtogenerate5validdescriptionsand5invaliddescriptionspersentence.\nForapproximately14%ofthesentences,were-feedGPTwithoneofitsvalidgenerations\nandusethe“Make-more-abstractsprompt”togenerate3additionalmoreabstractversion\nofthedescriptions. Finally,weusethe“Descriptiontosentenceprompt”togenerateasetof\nsentencesthatalignwiththe201testdescriptions,usedforevaluation.\nMainprompt:\nLet's write abstract descriptions of sentences. Example:\nSentence: Pilate 's role in the events leading to the crucifixion lent themselves\nto melodrama , even tragedy , and Pilate often has a role in medieval mystery\nplays .\nDescription: A description of a historical religious figure's involvement in a\nsignificant event and its later portrayal in art.\nNote: Descriptions can differ in the level of abstraction, granularity and the\npart of the sentence they focus on. Some descriptions neeed to be abstract, while\nothers should be concrete and detailed.\nFor the following sentence, write up 5 good and stand-alone, independent\ndescriptions and 5 bad descriptions (which may be related, but are clearly wrong).\nOutput a json file with keys 'good', 'bad'.\nSentence: {sentence}\nStart your answer with a curly bracket.\nA.1.1 Make-more-abstractPrompt\nSentence: in spite of excellent pediatric health care , several educational\nproblems could be noted in this tertiary pediatric center .\nDescription: Despite having advanced healthcare resources, certain deficiencies\nin education were identified at a medical center that serves children.\nA very abstract description: The provision of care at a specialized medical\ncenter was not optimal in one particular area, despite the presence of advanced\nresources.\n13",
"Apreprint\nSentence: {sentence}\nDescription: {description}\nA very abstract description:\nDescriptiontosentenceprompt\nCreate a JSON output with a key ‘sentences’ containing 15 Wikipedia-style different\nsentences. The sentences should align with the given description, i.e., the\ndescription must be a valid characterization of the sentences. Notice: (1) You\nmust avoid using words appearing in the description; (2) You MUST mention concrete\nentities such as names of people, places and events to make the sentence sound\nnatural; (3) you MUST make sure each sentence is relevant for the description;\n(4) IMPORTANT: you MUST make the sentences different from each other; they must\nnot mention the same topics. Description: '{description}'\nBe faithful to the description. Start your answer with a curly bracket.\nA.2 BaselineModels\nHyDE WeadaptedHyDEtoourscenarioby:a.addinganappropriatepromptforsentence\ngenerationmatchingthedescriptioninthequeryandb. replacingthedocumentretriever\nwithasentenceretriever(all-mpnet-base-v2).\nInstructor Instructorgeneratestask-specificembedidngsbyspecifyingthetypeoftask\nintheprompt. Weusetherecommendedprompt“RepresenttheWikipediadocumentfor\nretrieval”forthesentenceencoder,andtheclosestpromptfromSuetal.(2022)’sdataset,\n“RepresenttheWikipediasummaryforretrievingrelevantpassages:”,forthedescription\nencoder;variationsonthequeryprompt,suchas“RepresenttheWikipediadescriptionfor\nretrievingrelevantpassages:”,yieldsimilarresults.\nSNLIbaseline Thenotionofdescription-basedsimilarityisrelatedtoNLPtaskofrecog-\nnizingtextualentailment(Daganetal.,2005;Bowmanetal.,2015a)(seebelowinSection6).\nAssuch,itisnaturaltoaskhowdomodelstrainedonpopularRTEdatasets,suchasSNLI\n(Bowman et al., 2015b), fare on this task. We extract entailment and neutral pairs from\nthe SNLIdataset, and finetunean MPnet-base model for 30epochs with the objectiveof\nminimizingtheInfoNCElossEq.(2),wherehypothesisisthequery,thenegativepairsare\ntakenfromneutralpremiseswhilethepositiveistheentailingpremise. Wethenevaluate\nthismodelinthesamewayweevaluatetheotherbaselines.\n14",
"Apreprint\nA.3 Automatedevaluationdata\nDescription Validsentence Invalidsentence\nAperiodofdifficultyandsorrowforan Thedeathofhisbelovedmother Thisindividualbuildingwasa\nindividual. wasanextremelydifficultand difficultplacetolivein.\nsorrowfultimeforAlbert.\nAshiftinthewaypeoplearereferred In the current era, more and Alicewasreferredtoas’miss’the\ntohasoccurred. morepeoplearepreferringtogo samewaysheusedtobeinthe\nbytheirgivenname,ratherthan pre-quarantineperiod.\ntraditionaltitles.\nThehonoringofanactor’slegacy. On10April2020,aceremony Thespiansfromalloverthena-\nwasheldattheTCLChineseThe- tionhadgatheredinLosAngeles\natreinHollywoodtocommemo- torecognizetheimmenseinflu-\nratethelateactorPeterO’Toole, enceofveterandirectorStanLi.\nwhopassedawayin2013.\nTheactoftwoindividualsreachinga Thetwoleadersofdifferentna- Threehighschoolfriends,Alex,\nmutualunderstanding. tionsdecidedtosetasidetheir Jack,andRachel,finallyreached\ndifferencesandreachapeaceful amutualagreementoverwhich\nunderstanding. dessertthey’dorderatthecafete-\nria.\nAdismissalofaconceptbyarenowned AlthoughAlbertEinsteinhighly Theacclaimedacademicdisas-\nscholar. esteemedscience,hestronglyde- sociated himself from the re-\nniedthepossibilityofperpetual searcherhehadoncechampi-\nmotion. oned.\nAfederalgrandjury’sinvestigation A federal grand jury has Thefederalgrandjuryiscon-\nintoapoliticalcorruptioncase. launchedaninvestigationinto ductingathoroughinvestigation\na political corruption scandal intothedevastatingfloodsthat\ninvolvingprominentfiguresin occurredacrossthenation.\nthegovernment.\nHeTheeffectofadecreaseinthenum- Thedecliningtrendinthenum- Predators have evolved over\nberofpredators. berofpredatorshascausedase- time, playing a critical role\nveredepletioninthepreypopu- inecology,occupyingdifferent\nlation. nichesandcompetingwitheach\nother.\nTable3: Examplesofgeneratedtrainingdata,includingtheoriginalsentence,thegoodand\nbaddescriptions\nTable 3 presents a sample of descriptions from the 201 examples test set, alongside one\ninvalidandoneinvalidsentence(generatedbyGPT3)perdescription. Thesewereusedin\ntheautomaticevaluation(Section5.2).\n15",
"Apreprint\nA.4 RecallResults\n1.0\n0.9\n0.8\n0.7\n0.6\n0.5\n0.4\n0.3\n0.2\n0.1\n0.0\n0 500 1000 1500 2000\nk\nk@llacer-dilaV\n1.0\n0.9\n0.8\n0.7\n0.6\nMPnet\nInstructor 0.5\nE5\nSNLI 0.4\nHyDE\nBM25 0.3\nAbstract-sim (ours)\nContriver 0.2\nGTE\nBGE 0.1\nEmber\n0.0\n0 500 1000 1500 2000\nk\nk@llacer-dilavnI\nMPnet\nInstructor\nE5\nSNLI\nHyDE\nBM25 Abstract-sim (ours)\nContriver\nGTE\nBGE\nEmber\nFigure4: Recallautomaticevaluationresults(Section5.2): valid-recall@k(left, higheris\nbetter) and invalid-recall@k (right, lower is better) for abstract-sim and the baselines.\nVerticallinesrepresent1standarddeviation.\nFigureFig.4presentsvalid-recall@k(higherisbetter)andinvalid-recall@k(lowerisbetter)\nfortheautomaticevaluationexperiment(Section5.2).\nA.5 AblationofLossComponents\n1.0\n0.9\n0.8\n0.7\n0.6\n0.5\n0.4\n0.3\n0.2\n0.1\n0.0\n0 500 1000 1500 2000\nk\nk@llacer-dilaV\n1.0\nonly-infonce\nonly-triplet 0.9\ntriplet+infonce\n0.8\n0.7\n0.6\n0.5\n0.4\n0.3\n0.2\n0.1\n0.0\n2 4 6 8 10 12\nk\nk@noisicerP\nonly-infonce\nonly-triplet\ntriplet+infonce\nFigure5: Ablationresultsontheautomaticevaluation(Section5.2).\nFig.5presentstheresultsofautomaticevaluationwhentrainingmodelswiththeindividual\nlosscomponents(onlythetripletloss,oronlytheinfo-NCEloss)comparedwithusingthe\ncombinationofthetwolosses.\n16",
"Apreprint\nA.6 Human-evaluationInterface\nThisistheinterfaceusedforMTurkevaluation:\n17",
"Apreprint\nThisistheinterfacewithaninstantiateddescriptionsand10retrievedsentences(5from\nbaselinesand5fromourmodel,presentedinrandomorder).\nThisistheinterfaceweusedforassessingthecoverageoftheGPT3generateddescription\nanditscorrespondingsentence.\n18"
] |
|
[
"Ada-Instruct: Adapting Instruction Generators for\nComplex Reasoning\nWanyunCui,QianleWang\nShanghaiUniversityofFinanceandEconomics\[email protected], [email protected]\nABSTRACT\nGeneratingdiverseandsophisticatedinstructionsfordownstreamtasksbyLarge\nLanguageModels(LLMs)ispivotalforadvancingtheeffect. Currentapproaches\nleverage closed-source LLMs, employing in-context prompting for instruction\ngeneration. However, in this paper, we found that in-context prompting cannot\ngeneratecomplexinstructionswithlength≥100fortaskslikecodecompletion.\nTo solvethis problem, weintroduce Ada-Instruct, anadaptive instruction gener-\nator developed by fine-tuning open-source LLMs. Our pivotal finding illustrates\nthat fine-tuning open-source LLMs with a mere ten samples generates long in-\nstructions that maintain distributional consistency for complex reasoning tasks.\nWeempiricallyvalidatedAda-Instruct’sefficacyacrossdifferentapplications,in-\ncluding codecompletion, mathematical reasoning, and commonsense reasoning.\nThe results underscore Ada-Instruct’s superiority, evidencing its improvements\noveritsbasemodels,currentself-instructmethods,andotherstate-of-the-artmod-\nels.1\n1 INTRODUCTION\nRecent studies have focused on using close-source LLMs (e.g. ChatGPT) to generate large-scale\ntrainingdatabasedonlimitedsamples. Aprevalentapproachiscalled“self-instruct”(Wangetal.,\n2022), which involves having ChatGPT sequentially generate both instructions and answers (Sun\netal.,2023;Pengetal.,2023;Taorietal.,2023;Schick&Schu¨tze,2021;Honovichetal.,2022;Ye\netal.,2022;Mengetal.,2022;2023). Thecoreideaistostartfromaninitialpoolofinstructions\nandrandomlyutilizefew-shotsamplesasin-contextexamplestoproducenewinstructions.\nWeobservethatforinstructiongenerationprocessesbasedontheaforementionedself-instructstrat-\negy,in-contextlearning(ICL)isgenerallymuchmorefavoredoverfine-tuning(FT).Wehypothe-\nsizethatthispreferencearisesbecauserecentresearchhasdemonstratedthat,infew-shotscenarios,\nICLexhibitssuperiorout-of-distributiongeneralizationcapabilitiescomparedtoFT(Sietal.,2022;\nAwadalla et al., 2022; Utama et al., 2021). The lack of out-of-distribution generalization hampers\ntheabilityofFT-basedmodelstogeneralizebeyondthefew-shotsamplestothetargetdistribution,\nthusconstrainingtheircapacitytogeneratelarge-scalesampleswithhighdiversity.\nHowever, our observations reveal that self-instruct has a critical flaw in generalization—it strug-\nglestogeneratecomplexinstructions. Wefoundthatevenwhenpresentedwithcomplexexamples,\nand explicit requests LLMs to generate instructions such that “the instructions should not be too\neasy”and“generatealgorithmsofintermediatelevel”,theLLMspersistinproducingshort,simplis-\nticinstructions. InFigure1(a)andFigure1(c), weplotthecomplexitydistributionofinstructions\ngeneratedbySelf-InstructonHumanEval-abenchmarkforprogramming,andonGSM8k-abench-\nmark for math. The complexity is measured by instruction length. When compared to the actual\n1Codeisavailableathttps://github.com/wangitu/Ada-Instruct\n1\n3202\ntcO\n01\n]LC.sc[\n2v48440.0132:viXra",
"2.5\n2.0\n1.5\n1.0\n0.5\n0.0\n0 50 100 150 200 250 300\nTokens\n)%(\nycneuqerF\nHumanEval\n2.5\nSelf-Instruct\n2.0\n1.5\n1.0\n0.5\n0.0\n0 50 100 150 200 250 300\nTokens\n(a) Length distribution by Self-Instruct on\nHumanEval.\n)%(\nycneuqerF\nHumanEval\nAda-Instruct\n(b) Length distribution by Ada-Instruct on\nHumanEval.\n4.0\n3.5\n3.0\n2.5\n2.0\n1.5\n1.0\n0.5\n0.0\n0 20 40 60 80 100 120 140\nTokens\n)%(\nycneuqerF\n4.0\nGSM8K\nSelf-Instruct 3.5\n3.0\n2.5\n2.0\n1.5\n1.0\n0.5\n0.0\n0 20 40 60 80 100 120 140\nTokens\n(c) Length distribution by Self-Instruct on\nGSM8k.\n)%(\nycneuqerF\nGSM8K\nAda-Instruct\n(d) Length distribution by Ada-Instruct on\nGSM8k.\nFigure 1: Length Distribution of Different Methods. The length is measured by the number of\ntokens. Both Ada-Instruct and Self-Instruct initiate with the same 10 instructions. Self-Instruct\nstruggles to generate long, complex instructions. In contrast, Ada-Instruct successfully produces\ninstructionswhoselengthdistributionalignsconsistentlywiththetargetdatasets.\ndistribution,wenoticeamarkedinabilitytogenerateinstructionsexceeding100/60tokensonHu-\nmanEvalandGSM8k,respectively. Thislimitationcurtailstheapplicabilityofself-instructinmore\nsophisticatedtasks.\nIn this paper, we unveil a novel insight regarding the sample generation capabilities of FT mod-\nels. Surprisingly,wefindthatevenwhenrelyingsolelyon10samples,astraightforwardfine-tuned\nmodeliscapableofgeneratinginstructionsthatalignwiththetargettaskdistribution. Inparticular,\ntheFTmodelsareabletogeneratelongandcomplexinstructions. InFigure1(b),FTmodelsgen-\nerateinstructionsoflength≥ 100forHumanEval,andinFigure1(d),oflength≥ 60forGSM8k,\nbothmatchingtheactualdistribution.\nBesides, generating samples with FT models brings more advantages. The generated instructions\ncanspanacrossdifferentregionsofthetargetdistribution(§4.4.1),remainofhighdiversity(§A),\nhighquality(§4.4.2). Besides,generatinginstructionwithopen-sourceLLMsismuchcheaperthan\nICLfromclose-sourceLLMs(e.g. ChatGPT).\nAccordingtothesefindings,weintroduceAda-Instruct,afew-shotinstructiongenerationprocedure\nfordownstreamtasks. ThethreephasesoftheoverallprocessareillustratedinFigure2. Inthemost\ncriticalStep1,wefine-tuneopen-sourceLLMsusingfew-shottasksamplesforinstructiongenera-\ntion. Utilizingthefine-tunedinstructiongenerator,wethengeneratealargenumberofinstructions\nthatarealignedwiththedistributionofthetargetdownstreamtasks.Thisapproachdivergesfromthe\ntypicaluseofin-contextlearning(ICL)forinstructiongenerationinSelf-Instructstrategies(Wang\netal.,2022;Taorietal.,2023). Step2-3adheretoaconventionalSelf-Instructmethodology.\nInsummary,ourcontributionsinthispaperare(1)Weuncoveranewinsightintothesamplegener-\nationcapabilitiesofself-instruct,showingthatICLcannotgenerateinstructionswithhighcomplex-\n2",
"ity. Inconstract,werevealthatFTmodelsgeneratehighlydistinctiveandtask-alignedinstructions\nforcomplextasks. (2)WeintroduceAda-Instruct, afew-shotinstructiongenerationmethodology,\nwhichuniquelyleveragesfine-tuninginlieuofthepredominantlyusedSelf-Instruct. Thisapproach\nnot only ensures the generation of large volumes of high-quality instructions, mitigating the chal-\nlenges posed by data sparsity and instruction diversity, but also offers a cost-effective alternative\ntomethodsreliantonclosed-sourceLLMs. (3)WeverifytheeffectivenessandefficiencyofAda-\nInstruct through empirical validations, showcasing its capability to produce diverse samples span-\nningvariousregionsofthetargetdistribution.\n2 RELATED WORK\nSampleGenerationviaLLMsRecentworkshaveexploredtheuseofLLMsforsamplegeneration,\noftenwithintheframeworkofSelf-Instruction(Chenetal.,2023). Thistypicallyinvolvesstarting\nfromaninitialpoolofinstructionsandhavingtheLLMsiterativelygeneratenewinstructionsalong\nwith corresponding answers. Most prior work in the realm of instruction generation has relied on\nICL(Wangetal.,2022;Taorietal.,2023;Sunetal.,2023;Xuetal.,2023;Honovichetal.,2022;\nMengetal.,2022). Variousstudieshaveprimarilyfocusedonimprovingtheself-instructapproach\nindifferentproblemscenarios.\nHowever, alimitationofthisparadigm, aswehaveobserved, isthatICLlackthecapacitytogen-\nerate complex samples based solely on in-context examples. While more intricate samples could\npotentiallybeproducedthroughevolutionarystrategies,suchasEvol-Instruct(Xuetal.,2023;Luo\netal.,2023a;b),thesemanually-designedtacticsriskgeneratingsamplesthatdonotalignwiththe\ntargettaskdistribution.\nFewGen (Meng et al., 2023) is the only method we have identified that substitutes fine-tuning for\nIn-ContextLearning(ICL)insamplegeneration.However,FewGennecessitatessophisticatedmeta-\nlearningandislimitedtoclassificationtasks. Incontrast,Ada-Instructissubstantiallysimplerand\nmoregeneral.\nICL vs FT Previous exploratory studies have aimed to compare the performance of ICL and FT\nmethodologies. Some research suggests that ICL exhibits more robust out-of-distribution gener-\nalization compared to FT (Si et al., 2022; Awadalla et al., 2022; Utama et al., 2021). However,\nsomerecentstudies(Mosbachetal.,2023)arguethattheseearliercomparisonsmaybebiased. The\nunfairness arises from using different model architectures for comparison (e.g., GPT-3-based ICL\nversusRoBERTa(Liuetal.,2019)-basedFT)orbybasingresultsonsmall-scalemodels. Inmore\nequitableexperimentalsetups, researchersfoundthatFToutperformsICL(Mosbachetal.,2023),\ntherebylendingsupporttoourstrategyofusingFTmodelsforinstructiongeneration.\n3 METHOD\nIn this section, we outline the methodology behind Ada-Instruct, the adaptive instruction-based\nframeworkfortrainingtask-specificLLMs.Ada-Instructisdividedintothreedistinctstep:1)Learn-\ninganinstructiongeneratorandgeneratemassiveinstructions,2)LabelgenerationwithChatGPT,\nand 3) Training LLMs for downstream tasks. Below, we delve into the details of each step. The\noverallworkflowisshowninFigure2.\n3.1 LEARNINGANINSTRUCTIONGENERATOR(STEP1)\nThe first step focuses on learning an instruction generator using a small set of samples. In most\nreal-worldscenarios, obtaininglargelabeleddatasetsforeverynewdownstreamtaskisinfeasible.\nHence,aninstructiongeneratorcouldserveasanintermediary,convertingsmallsetsofsamplesinto\nactionableinstructionsfordatalabelingortaskunderstanding.\nGivenatargetdownstreamtaskT andasmallsetofsamplesS ={(x ,y ),(x ,y ),...,(x ,y )},\n1 1 2 2 n n\ntheobjectiveistofine-tuneaninitialLLMM(θ)withparametersθ toproduceinstructionsI that\nhaveidenticaldistributionwiththeinstructionX oftaskT andarebeneficialforfine-tuning.\nThegoalofthefine-tuningislearningtogenerateinstructionsX. Thusitsobjectiveistooptimize\ntheparametersθ oftheLLMtomaximizetheconditionallikelihoodofthetargetsequencesgiven\n3",
"Step 1:Ada-Instruct\nfine-tune generate\nStep 2: Step 3:\nfew-shot open-source LM massive generate fine-tune\ninitial samples as instruction generator instructions labels\nStep 1: Previous methods LLM\nmassive training task-specific\nsamples model\nin-context generate\nprompt\nfew-shot closed-source LM massive\ninitial samples as instruction generator instructions\nFigure 2: How Ada-Instruct works. We fine-tune LLMs as instruction generator from few-shot\ninitialsamples(step1),whilepreviousself-instructmethodsusein-contextpromptingandclosed-\nsourceLLMs. WethenuseChatGPTtogeneratelabels(step2),andfine-tuneatask-specificmodel\nwiththelabeledsamples(step3).\ntheircorrespondinginstructions::\n1 (cid:88)\nL (θ)=− logP (x |θ) (1)\ninst n M i\n(x,y)∈S\nHere, P (x |θ) denotes the probability of observing the target instruction x under the current\nM i i\nmodelparametersθ. θisinitializedasthepre-trainedparameters. Incausallanguagemodeling,the\nprobabilityofthetargetinstructionisrepresentedastheproductoftheconditionalprobabilitiesof\ntheindividualtokensinit.\nGeneratingMassiveInstructions: Afterfine-tuning,theinstructiongeneratorisusedtogeneratea\nlargevolumeofinstructions. Theseinstructionsserveasthebasisforthesubsequentphases,acting\nasascaffoldforgeneratinghigh-qualityinstructiondata.\nFiltering Duplicate Instructions: As massive instructions are generated from the LLM trained\nby a few samples, one issue is whether these instructions are duplicated. We assume that if two\ninstructions are highly similar, using the two instructions to fine-tune the final LLM will be less\neffective.Tofurtherensuretheuniquenessofgeneratedinstructions,asimplefilteringmechanismis\nemployed. Thismechanismusesapre-trainedsentenceembeddingmodeltocalculatethesemantic\nsimilarity between generated instructions. If the semantic similarity between two instructions is\nabove a predetermined threshold, the latter instruction is filtered out to avoid redundancy. In this\npaper,weuseMPNet(Songetal.,2020)tocomputethesemanticsimilarities.\n3.2 LABELGENERATIONWITHCHATGPT(STEP2)\nIn the second step, we leverage a high-quality closed-source LLM, ChatGPT 2, to generate labels\nfor the instructions produced in step 1. Using ChatGPT alleviates the need for extensive manual\nlabeling,providingacost-efficientandtime-effectivewaytoaccumulatelabeleddatabasedonthe\ninstructionsgeneratedinstep1(Gilardietal.,2023).\nGiven the set of instructions I = {x ,x ,...,x }, The objective here is to generate their corre-\n1 2 m\nspondinglabelsy ,y ,...,y .ForeachinstructionIintheset,ChatGPTgeneratesacorresponding\n1 2 m\nresponse,therebytransformingI intoanewtrainingsetS={(x ,y ),...,(x ,y )}.\n1 1 m m\n3.3 TRAININGLLMSFORDOWNSTREAMTASKS(STEP3)\nThefinalsteputilizesthecompletetrainingsamplesS′ obtainedfromstep2totrainLLMsforthe\ntargetdownstreamtasks.\n2Weusegpt-3.5-turbointhispaper\n4",
"Table1: Resultsofpass@1(%)onHumanEvalandMBPP,showcasingrelativeimprovementsover\nthe base model. Results related to Code LLAMA are from Rozie`re et al. (2023). Results of other\nbaselinesandfromLuoetal.(2023b). WefollowRozie`reetal.(2023)toadoptagreedydecoding\nstrategyinAda-Instruct. Refertotheappendixformoredetails.\nInitial SFT\nModel Params HumanEval MBPP\nData Data\nPaLM - - 540B 26.2 36.8\nPaLM-Coder - - 540B 36.0 47.0\nPaLM2-S - - - 37.6 50.0\nStarCoderBase - - 15.5B 30.4 49.0\nStarCoderPython - - 15.5B 33.6 52.7\nStarCoderPrompted - - 15.5B 40.8 49.5\nCode-Cushman-001 - - 12B 33.5 45.9\nGPT-3.5 - - - 48.1 52.2\nGPT-4 - - - 67.0 -\nInstructiongenerationviaSelf-Instruct\nInstructCodeT5+ - 20k 16B 35.0 -\nWizardCoder 20k 78k 13B 64.0 55.6\nSelf-Instruct-Alpaca 21 20k 13B 48.8 47.6\nBaseModels\n13B 36.0 47.0\nCodeLLAMA - -\n34B 48.8 55.0\n13B 42.7 49.4\nCodeLLAMA-Insturct 10 14k\n34B 41.5 57.0\nUnnaturalCodeLLAMA - 15k 34B 62.2 61.2\n13B 43.3 49.0\nCodeLLAMA-Python(base) - -\n34B 53.7 56.2\nAda-Instruct-HumanEval 10 6.4k 13B 64.0(+47.8%) -\nAda-Instruct-MBPP 10 10k 13B - 55.6(+13.5%)\nTheobjectivefunctionisalsoacasuallanguagemodelinglossoverthegivensamples,adjustedto\nfitthelabelsofthenewsetofsamplesSfromStep2. AnewLLMM(θ)isusedforfine-tuningwith\nthepre-trainedparameterinitialization:\n1 (cid:88)\nL\ntask\n(θ)=−\nm\nlogPM(y|x;θ) (2)\n(x,y)∈S\n4 EXPERIMENTS\n4.1 CODECOMPLETION\nSetup: We conducted an application experiment on the code completion task. For this purpose,\ntwowidely-usedbenchmarkswereused: HumanEval(Chenetal.,2021)andMBPP(Austinetal.,\n2021). In both experiments involving Ada-Instruct, we started with an initial set of 10 samples.\nFor the MBPP dataset, these samples were randomly selected from its development set. Since\nHumanEval only provides a test set, we manually curated 10 problems from LeetCode and the\nMBPPdevelopmentsetastheinitialsamples,ensuringthedifficultydistributioncloselyresembled\nthatofHumanEval.TheseinitialsamplesweresubsequentlyreformattedtotheHumanEvalqueries.\nWeuseCodeLLAMA-Python(13B)(Rozie`reetal.,2023)asourbasemodel.\nBaselines:Weconsiderstate-of-the-artmodelsasourbaselines,includingPaLM(Chowdheryetal.,\n2022), PaLM-Coder (Chowdhery et al., 2022), PaLM 2-S (Anil et al., 2023), StarCoder (Li et al.,\n2023), GPTs (OpenAI, 2023). We also compare with models that uses self-instruct framework\nfor sample augmentation, including InstructCodeT5+ (Wang et al., 2023) and WizardCoder (Luo\netal.,2023b). Andwealsocomparewiththebasemodel,CodeLLAMA(Rozie`reetal.,2023),to\ninvestigatetheimprovementbyAda-Instruct.\n5",
"Table2: ComparisonofGeneratedInstructions.\nType Instruction\nSelf-Instruct Givenalistofwords,createadictionarytocountthenumberofoccurrencesof\neachword.\nEvol-Instruct Createaprogramthatcanfilteroutwordsofastringthatcontainaspecificchar-\nacterandhavealengthgreaterthan3. Additionally,ifthecharacterisavowel,\nthe program should replace it with the next vowel in the vowel sequence. The\nprogramshouldthenoutputthemodifiedstring,whilemaintainingtheoriginal\nwordorder.\nAdditionally,youneedtohandlecaseswherethestringcontainsspecialcharac-\ntersornumbers. Ifawordcontainsanyspecialcharactersornumbers,itshould\nbeexcludedfromtheoutput.\nAda-Instruct Youaregivenanarrayofmeetingtimerangesinanyorder. Eachmeetingtime\nranges[i]=[start i,end i]meansthatyouneedattendameetingduringthetime\nrange [start i, end i). Return the minimum number of conference rooms re-\nquired.\nEffectofAda-Instruct: WeshowtheresultsinTable1. Whencomparedtostate-of-the-artbase-\nlines specifically designed for the code completion task, Ada-Instruct maintains a significant edge\nineffectiveness. OnHumanEval,[email protected],secondonlytoGPT-4andsurpassingallopen-\nsourcebaselinesexceptWizardCoder,includingthe34BversionofCodeLLAMA.Itsperformance\nis competitive with WizardCoder. However, we require much less initial data and SFT data then\nWizardCoder. In MBPP, it still manifests the top performance of a 13B parameter model. This\nvalidatestheeffectivenessofAda-Instruct.\nComparisonwithSelf-InstructCodeLLAMA-InstructusesaSelf-Instructstrategystartingfrom\n10 initial samples. According to Table 1, Ada-Instruct significantly outperforms Code LLAMA-\nInstruct-34BonHumanEval, andiscompetitivewithitonMBPP.UnnaturalCodeLLAMAisan-\nothermodelthatusesSelf-InstructandICLforinstructiongeneration.Ada-Instructalsooutperforms\nits34BversiononHumanEval.\nAblation:TogiveamorestraightforwardcomparisonwithAda-InstructandICL-baseSelf-Instruct,\nwe trained a baseline model of consistent settings with Ada-Instruct, except that the instructions\nare from CodeAlpaca (Chaudhary, 2023), a collection of code instructions generated by Self-\nInstruct. We denote it as Self-Instruct-Alpaca. In Table 1, Ada-Instruct consistently outperforms\nSelf-Instruct-Alpaca,verifyingitsadvanceininstructiongeneration.\nImprovements over Base Models When compared to the base models, especially to the Code\nLLAMA-Python (13B) which Ada-Instruct directly builds upon, Ada-Instruct exhibits a notable\nimprovement in performance. This enhancement is particularly significant on HumanEval, where\nthe relative increase reaches 47.8%. This substantial boost underscores the adaptability of Ada-\nInstruct,illustratingitscapabilitytoadaptLLMstodownstreamtasks,evenwheninitiatedwithas\nfew as 10 samples. The results lend compelling evidence to Ada-Instruct’s efficacy in optimizing\nlanguagemodelsforspecifictasks.\nEfficiency in Labeling: It is worth noting that Ada-Instruct achieves these improvements while\nrelying on a much smaller number of initial labeling samples (10) than other models. Despite the\nlimited sample size, Ada-Instruct consistently outperforms baselines, making it a more efficient\nchoicefortasksthatrequirefewerlabeledsamples.\nCase Study: In Table 2, we present instructions generated by Ada-Instruct on HumanEval. We\nobserve that the instructions generated by Self-Instruct are predominantly short. In contrast, Ada-\nInstruct is capable of producing longer instructions that align well with the target task. Although\nEvol-Instruct (Xu et al., 2023; Luo et al., 2023b) can generate longer instructions by iteratively\naddingconstraints,theseinstructionstendtobeunnaturalanddonotalignwellwiththedistribution\nofthedownstreamtasks.\n6",
"Table3: Resultsofpass@1(%)onGSM8kandMATH,demonstratingrelativeimprovementsover\nthe base model. Results of baselines are from Luo et al. (2023a). The decoding strategy of Ada-\nInstructwassourcedfromLuoetal.(2023a). Refertotheappendixformoredetails.\nInitial SFT\nModel Params GSM8k MATH\nData Data\nFalcon - - 40B 19.6 2.5\nBaichuan-chat - - 13B 23.9 -\nVicunav1.3 - - 13B 27.6 -\nGPT3 - - 175B 34.0 5.2\nText-davinci-002 - - 175B 40.7 19.1\nChinchilla - - 70B 43.7 -\nGPT-3.5 - - - 57.1 -\nPaLM2 - - 540B 80.7 34.3\nGPT-4 - - - 92.0 42.5\nInstructiongenerationviaSelf-Instruct\nSelf-Instruct-GSM8k 10 10k 13B 30.8 -\nSelf-Instruct-MATH 10 10k 13B - 5.8\nBaseModels\n13B 28.7 3.9\nLLAMA2(8-shot) - - 34B 42.2 6.2\n70B 56.8 13.5\nAda-Instruct-GSM8k 10 10k 13B 48.6(+69.3%) -\nAda-Instruct-MATH 10 10k 13B - 8.8(+125.6%)\n4.2 MATH\nSetup: We applied Ada-Instruct to the field of math and evaluated it on two benchmarks:\nGSM8k (Cobbe et al., 2021) (easier) and MATH (Hendrycks et al., 2021) (harder). We randomly\nsampled 10 instructions from the training set of each dataset as the initial samples. We guarantee\nthatthe10samplesfromMATHdonotcontaindrawingscripts.Thebasemodelemployedherewas\nLLAMA2.\nEffect: InTable3,weobservedasignificantperformanceenhancementofAda-Instructincompar-\nisonwiththebasemodel. Ada-Instructdemonstratedarelativeimprovementof69.3%and125.6%\nonGSM8kandMATH,respectively,comparedtothebasemodel(LLAMA2-13B).Thissurpassed\ntheperformanceofLLAMA2-34Bandachievedstate-of-the-artresultsinfew-shotsamplegenera-\ntionmodels.\nAblation: In Table 3, we also compare the performance of Ada-Instruct and Self-Instruct. The\nsettings for both Self-Instruct and Ada-Instruct are kept consistent, including the use of the same\n10initialsamples. TheonlydistinctionisthatSelf-InstructusesinstructionsgeneratedthroughICL\nandChatGPT.WeobservethatAda-InstructmarkedlysurpassesSelf-Instruct,verifyingtheefficacy\nofAda-Instructingeneratinginstructionsfordownstreamtasks.\n4.3 COMMONSENSEREASONING\nSetup: WeevaluatedtheeffectivenessofAda-InstructonCommonsenseQA(Talmoretal.,2019),a\nbenchmarkforcommonsensereasoning. Werandomlyselected10samplesfromthetrainingsetto\nserveastheinitialsamples. WechooseLLAMA2-13Basourbasemodel.\nResults: Based on the results presented in Table 4, we observe a substantial improvement in per-\nformanceattributedtoAda-Instruct. Itmanifestsa28%relativeimprovementineffectivenesscom-\nparedtoits13Bbasemodel. This13BmodelsurpassesothermethodsincludingLLAMA2-34B,\nfalling only behind the 7-shot LLAMA 2-70B. The advancement demonstrates the proficiency of\nAda-Instructincommonsensereasoning.\n7",
"Table 4: Results on CommonsenseQA, illustrating the relative improvement over the base model.\nResultsrelatedtoLLAMA2arefromTouvronetal.(2023). ResultsofotherbaselinesarefromWu\netal.(2023). *: resultsaretestedonthedevset.\nModel Params Accuracy\nGPT-NeoX 20B 60.4\nBLOOM 176B 64.2\nOPT 66B 66.4\nBloombergGPT 51B 65.5\nBaseModels\n13B 67.3\nLLAMA2(7-shot) 34B 74.3\n70B 78.5\nLLAMA2(0-shot) 13B 59.0*\nLLAMA2(1-shot) 13B 62.8*\nLLAMA2(10-shot) 13B 68.1*\nAda-Instruct-CSQA 13B 75.5*(+28.0%)\n4.4 ANALYSISOFINSTRUCTIONGENERATION\n4.4.1 TASKCREATIVITY\nWe investigated whether the generated instructions are consistent with the target task distribution.\nGiven that we only used 10 initial samples, one major concern is that these samples do not fully\ncoverthedistributionofthetargettask,potentiallyleadingtogeneratedinstructionsthatonlylearn\nto resemble these initial instructions. To address this, we plot the distribution of the 10 initial\ninstructionsandthegeneratedinstructions.Additionally,weplotthedistributionofrealdownstream\ninstructionsfromthetrainingset,toverifywhetherthegeneratedinstructionsalignwiththeactual\ndistribution. We represent the semantics of the instructions using MPNet (Song et al., 2020) and\nvisualizedtheirdistributionusingt-SNE(VanderMaaten&Hinton,2008).\nForcomparison,wealsoplotinstructionsfromslightlydifferenttasks.ForMBPPwithPythonalgo-\nrithm instructions, we selected Python instructions from ShareGPT. These instructions, while also\ninvolvingPythonprogramming,emphasizepracticaldevelopmentneeds. ForGSM8k,weselected\nMATHinstructionsasacomparison.\nFigure3showthatthegeneratedinstructionsexhibitconsistentdistributionwiththetargettask. The\ninstructionsbyAda-Instructarenotconfinedtothevicinityofthe10trainingsamplesbutdemon-\nstrate the capability to expand to broader regions, aligning with the actual instruction distribution\nof the target task. Compared to the distribution of the reference datasets (ShareGPT-python and\nMATH), the instructions by Ada-Instruct are significantly closer to the target distribution. These\nobservationsvalidatethetaskcreativityofAda-Instruct.\n4.4.2 QUALITY\nToassessthequalityofthegeneratedinstructions,weevaluatedwhetherthegeneratedinstructions\nare coherent and logically sound. For this evaluation, we employed ChatGPT as the annotator.\nWe randomly sampled 200 instructions generated for MBPP and CommonsenseQA. We first told\nChatGPTthetaskdescriptionofMBPPandCommonsenseQA,andthenaskedChatGPT,“Doyou\nthinkthisinstructioniscoherentandlogicallysound? YesorNo.” Asabaseline,wealsoevaluate\nthequalityoftherealsamplesofthecorrespondingdatasetsasthequalityupperbound.\nAs can be seen in Table 5, the quality of the generated instructions approaches that of the real\nsamples,suggestingthatthegeneratedsamplespossesssufficientcorrectness.Whileasmallfraction\nofincorrectsamplesstillexist,wefurtherinvestigatetheimpactofsuchincorrectnessinSection4.5.\n8",
"30 MBPP 40 GSM8K\ntrain train\n20 Ada-Instruct Ada-Instruct\nShareGPT-Python 20 MATH\n10\n0\n0\n10 20\n20 Generalize beyond\ntraining samples to 40\nthe target distribution\n30\n40 20 0 20 40 20 10 0 10 20 30\n(a) DistributionofMBPP (b) DistributionofGSM8k\nFigure3: Distributionofgeneratedinstructionsshowtaskcreativitybeyondtheinitial10samples.\nTable5:Qualityofgeneratedinstructions,evaluatedbyChatGPT.Wecomparewiththerealinstruc-\ntions,showingthattheirqualityareclose.\nMBPP CommonsenseQA\nGenerated RealSamples Ratio Generated RealSamples Ratio\n80.5% 93.0% 86.6% 62.0% 65.0% 95.4%\n4.5 DOESTHEINFERIOREXPRESSIVENESSOFOPEN-SOURCEMODELSREALLYMATTER?\nDue to the inferior expressive capability of open-source LLMs compared to closed-source LLMs,\nsuch as ChatGPT, one major concern is the generated instructions of Ada-Instruct may still have\nlowerquality, especiallyforcomplextasks. Inthissubsection, weinvestigatetheactualimpactof\nthisinstructionsontheperformanceofdownstreamtasks.\nWeconsiderallMBPPsamplesgeneratedbyAda-Instructasnoisysamples. GiventhatMBPPsam-\nplesincludebothcodeandusecases,wetestifthegeneratedcodecorrectlypassthroughthecases.\nIf so, we regard them as correct samples. Among all generated noisy samples, we found 46.9%\nsamples are correct. We sampled different scales of original generated noisy samples (denoted by\nall)andcorrectsamplesonly(denotedbycorrect),respectively,andcomparedtheeffectsoftraining\nLLMsovertheminFigure4.\nWeobservedthattheeffectsontheoriginallygeneratednoisysamplesareclosetothosebasedon\ncorrectsamples,aphenomenonsimilartothefindinginHonovichetal.(2022). Theresultssuggest\nthat the distinction in effectiveness between noisy samples generated by open-source LLMs and\n56\n54\n52\n50\n48\n46\n44\n42\n100 200 400 1000 2000 4000 10000\nSamples\n)%(\n1@P\nall\ncorrect\nFigure4: EffectofallgeneratedinstructionsandcorrectinstructionsonlyonMBPP.\n9",
"closed-sourceLLMsmaynotbeasignificantfactorinsamplegeneration. Thisoffersnewinsights\nintotheadaptabilityandresilienceofmodelsinhandlinginstructionalnoise.\n5 CONCLUSION\nWe unveiled noval insights into the capabilities of instruction generation, demonstrating that the\nconventional ICL-based Self-Instruct fails to generate long and complex instructions. In contrast,\nwe revealed the proficiency of Ada-Instruct in generating task-aligned instructions, even with a\nlimited number of initial samples. Ada-Instruct ensures the generation of coherent, high-quality,\nanddiverseinstructionsthatalignwellwiththetargettaskdistribution,presentingagroundbreaking\nsolution to the challenges of data sparsity and diversity in instruction generation. Our empirical\nfindingsandthedemonstratedeffectivenessofAda-Instructunderscoreitspotentialforinstruction\ngeneration.\nREFERENCES\nRohan Anil, Andrew M Dai, Orhan Firat, Melvin Johnson, Dmitry Lepikhin, Alexandre Passos,\nSiamak Shakeri, Emanuel Taropa, Paige Bailey, Zhifeng Chen, et al. Palm 2 technical report.\narXivpreprintarXiv:2305.10403,2023.\nJacobAustin,AugustusOdena,MaxwellNye,MaartenBosma,HenrykMichalewski,DavidDohan,\nEllen Jiang, Carrie Cai, Michael Terry, Quoc Le, et al. Program synthesis with large language\nmodels. arXivpreprintarXiv:2108.07732,2021.\nAnas Awadalla, Mitchell Wortsman, Gabriel Ilharco, Sewon Min, Ian Magnusson, Hannaneh Ha-\njishirzi, andLudwigSchmidt. Exploringthelandscapeofdistributionalrobustnessforquestion\nansweringmodels. InFindingsoftheAssociationforComputationalLinguistics: EMNLP2022,\npp.5971–5987,2022.\nSahilChaudhary. Codealpaca: Aninstruction-followingllamamodelforcodegeneration,2023.\nJiaao Chen, Derek Tam, Colin Raffel, Mohit Bansal, and Diyi Yang. An empirical survey of data\naugmentationforlimiteddatalearninginnlp. TransactionsoftheAssociationforComputational\nLinguistics,11:191–211,2023.\nMark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared\nKaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. Evaluating large\nlanguagemodelstrainedoncode. arXivpreprintarXiv:2107.03374,2021.\nAakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam\nRoberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. Palm:\nScalinglanguagemodelingwithpathways. arXivpreprintarXiv:2204.02311,2022.\nKarl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser,\nMatthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, et al. Training verifiers to\nsolvemathwordproblems. arXivpreprintarXiv:2110.14168,2021.\nFabrizioGilardi,MeysamAlizadeh,andMae¨lKubli. Chatgptoutperformscrowd-workersfortext-\nannotationtasks. arXivpreprintarXiv:2303.15056,2023.\nDanHendrycks,CollinBurns,StevenBasart,AndyZou,MantasMazeika,DawnSong,andJacob\nSteinhardt. Measuring massive multitask language understanding. In International Conference\nonLearningRepresentations,2020.\nDan Hendrycks, Collin Burns, Saurav Kadavath, Akul Arora, Steven Basart, Eric Tang, Dawn\nSong, and Jacob Steinhardt. Measuring mathematical problem solving with the math dataset.\nInThirty-fifthConferenceonNeuralInformationProcessingSystemsDatasetsandBenchmarks\nTrack(Round2),2021.\nOr Honovich, Thomas Scialom, Omer Levy, and Timo Schick. Unnatural instructions: Tuning\nlanguagemodelswith(almost)nohumanlabor. arXivpreprintarXiv:2212.09689,2022.\n10",
"RaymondLi,LoubnaBenAllal,YangtianZi,NiklasMuennighoff,DenisKocetkov,ChenghaoMou,\nMarcMarone, ChristopherAkiki, Jia Li, Jenny Chim, etal. Starcoder: maythe sourcebe with\nyou! arXivpreprintarXiv:2305.06161,2023.\nYinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike\nLewis,LukeZettlemoyer,andVeselinStoyanov. Roberta: Arobustlyoptimizedbertpretraining\napproach. arXivpreprintarXiv:1907.11692,2019.\nHaipengLuo,QingfengSun,CanXu,PuZhao,JianguangLou,ChongyangTao,XiuboGeng,Qing-\nweiLin,ShifengChen,andDongmeiZhang. Wizardmath: Empoweringmathematicalreasoning\nforlargelanguagemodelsviareinforcedevol-instruct. arXivpreprintarXiv:2308.09583,2023a.\nZiyang Luo, Can Xu, Pu Zhao, Qingfeng Sun, Xiubo Geng, Wenxiang Hu, Chongyang Tao, Jing\nMa,QingweiLin,andDaxinJiang. Wizardcoder: Empoweringcodelargelanguagemodelswith\nevol-instruct. arXivpreprintarXiv:2306.08568,2023b.\nYuMeng,JiaxinHuang,YuZhang,andJiaweiHan.Generatingtrainingdatawithlanguagemodels:\nTowardszero-shotlanguageunderstanding. AdvancesinNeuralInformationProcessingSystems,\n35:462–477,2022.\nYuMeng, MartinMichalski, JiaxinHuang, YuZhang, TarekAbdelzaher, andJiaweiHan. Tuning\nlanguage models as training data generators for augmentation-enhanced few-shot learning. In\nInternationalConferenceonMachineLearning,pp.24457–24477.PMLR,2023.\nMarius Mosbach, Tiago Pimentel, Shauli Ravfogel, Dietrich Klakow, and Yanai Elazar. Few-\nshot fine-tuning vs. in-context learning: A fair comparison and evaluation. arXiv preprint\narXiv:2305.16938,2023.\nROpenAI. Gpt-4technicalreport. arXiv,pp.2303–08774,2023.\nBaolin Peng, Chunyuan Li, Pengcheng He, Michel Galley, and Jianfeng Gao. Instruction tuning\nwithgpt-4. arXivpreprintarXiv:2304.03277,2023.\nBaptisteRozie`re,JonasGehring,FabianGloeckle,StenSootla,ItaiGat,XiaoqingEllenTan,Yossi\nAdi,JingyuLiu,TalRemez,Je´re´myRapin,etal. Codellama: Openfoundationmodelsforcode.\narXivpreprintarXiv:2308.12950,2023.\nTimo Schick and Hinrich Schu¨tze. Generating datasets with pretrained language models. In Pro-\nceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp.\n6943–6951,2021.\nChengleiSi,ZheGan,ZhengyuanYang,ShuohangWang,JianfengWang,JordanLeeBoyd-Graber,\nandLijuanWang. Promptinggpt-3tobereliable. InTheEleventhInternationalConferenceon\nLearningRepresentations,2022.\nKaitaoSong,XuTan,TaoQin,JianfengLu,andTie-YanLiu. Mpnet: Maskedandpermutedpre-\ntraining for language understanding. Advances in Neural Information Processing Systems, 33:\n16857–16867,2020.\nZhiqing Sun, Yikang Shen, Qinhong Zhou, Hongxin Zhang, Zhenfang Chen, David Cox, Yiming\nYang, and Chuang Gan. Principle-driven self-alignment of language models from scratch with\nminimalhumansupervision. arXivpreprintarXiv:2305.03047,2023.\nAlonTalmor,JonathanHerzig,NicholasLourie,andJonathanBerant.Commonsenseqa:Aquestion\nansweringchallengetargetingcommonsenseknowledge. InProceedingsofthe2019Conference\nof the North American Chapter of the Association for Computational Linguistics: Human Lan-\nguageTechnologies,Volume1(LongandShortPapers),pp.4149–4158,2019.\nRohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy\nLiang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model.\nhttps://github.com/tatsu-lab/stanford_alpaca,2023.\n11",
"HugoTouvron,LouisMartin,KevinStone,PeterAlbert,AmjadAlmahairi,YasmineBabaei,Niko-\nlayBashlykov,SoumyaBatra,PrajjwalBhargava,ShrutiBhosale,etal. Llama2: Openfounda-\ntionandfine-tunedchatmodels. arXivpreprintarXiv:2307.09288,2023.\nPrasetya Utama, Nafise Sadat Moosavi, Victor Sanh, and Iryna Gurevych. Avoiding inference\nheuristicsinfew-shotprompt-basedfinetuning. In Proceedingsofthe2021ConferenceonEm-\npiricalMethodsinNaturalLanguageProcessing,pp.9063–9074,2021.\nLaurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine\nlearningresearch,9(11),2008.\nYizhongWang,YeganehKordi,SwaroopMishra,AlisaLiu,NoahASmith,DanielKhashabi,and\nHannaneh Hajishirzi. Self-instruct: Aligning language model with self generated instructions.\narXivpreprintarXiv:2212.10560,2022.\nYue Wang, Hung Le, Akhilesh Deepak Gotmare, Nghi DQ Bui, Junnan Li, and Steven CH Hoi.\nCodet5+: Open code large language models for code understanding and generation. arXiv\npreprintarXiv:2305.07922,2023.\nShijie Wu, Ozan Irsoy, Steven Lu, Vadim Dabravolski, Mark Dredze, Sebastian Gehrmann, Prab-\nhanjanKambadur,DavidRosenberg,andGideonMann. Bloomberggpt: Alargelanguagemodel\nforfinance. arXivpreprintarXiv:2303.17564,2023.\nCan Xu, Qingfeng Sun, Kai Zheng, Xiubo Geng, Pu Zhao, Jiazhan Feng, Chongyang Tao, and\nDaxin Jiang. Wizardlm: Empowering large language models to follow complex instructions.\narXivpreprintarXiv:2304.12244,2023.\nJiacheng Ye, Jiahui Gao, Qintong Li, Hang Xu, Jiangtao Feng, Zhiyong Wu, Tao Yu, and Ling-\npeng Kong. Zerogen: Efficient zero-shot learning via dataset generation. arXiv preprint\narXiv:2202.07922,2022.\nTianyiZhang,VarshaKishore,FelixWu,KilianQWeinberger,andYoavArtzi. Bertscore: Evaluat-\ningtextgenerationwithbert. InInternationalConferenceonLearningRepresentations,2019.\nA DIVERSITY\nGiven that our instruction generator was trained from merely 10 examples, a natural concern is\nwhether the generated instructions are sufficiently diverse or if they overfit to a limited number of\ntrainingsamples. Toaddressthis,weassessedthediversityofthegeneratedsamples. Specifically,\nwe randomly sampled 10000 pairs of generated samples and calculated their similarity scores. A\nhighsimilarityscoreforapairofinstructionsindicatesredundancy.Therefore,foramorediverseset\nofgeneratedsamples,wedesirealowersimilarityscoredistribution.Wefollowedtheapproachused\nin a previous work (Honovich et al., 2022) to employ BERTscore (Zhang et al., 2019) to measure\nthesimilaritybetweeninstructionpairs. ThevisualizationoftheresultscanbeseeninFigure5.\nWecomparedthediversityofinstructionsgeneratedbyAda-Instructandself-instructstrategy. As\nclearly evident from Figure 5, the samples from Ada-Instruct exhibited lower similarity between\npairs. This indicates that Ada-Instruct produces instructions with higher diversity. Given that the\nexpressive capacity of the base model for Ada-Instruct (LLAMA 2-13B) is evidently weaker than\nChatGPT,thisunderscorestheeffectivenessofAda-Instructingeneratingdiverseinstructions.\nB TRAINING DETAILS\nWhen fine-tuning in Step 1, we train the models for 40 epochs with 10% warm-up steps for all\ntasks. Weuseabatchsizeof10,alearningrateof1e-6,aweightdecayof1e-2,acosinelearning\nrateschedulerandbf16precisionforalltasksexceptforMATH.WefindMATHmuchharderthan\nothertaskssoweapplyalowerlearningrateof8e-7tobetteradapttothetask. Foralltasksunder\nconsideration,weadoptthefirstcheckpointatwhichthelossvalueresideswithintherangeof0.2\nto0.4toavoidoverfitting. Thischeckpointisselectedfromthe25th, 30th, 35thand40thtraining\nepochs.\n12",
"500\n400\n300\n200\n100\n0\n0.4 0.2 0.0 0.2 0.4 0.6 0.8\nSimilarity (BERTScore)\ntnuoC\nSelf-Instruct\nAda-Instruct\nFigure5: SimilarityscoredistributionforAda-Instructandself-instruct. Ada-Instructgenerallyhas\nlowersimilarityscores,indicatingthatithashighdiversity.\nWhen fine-tuning in Step 3, for all tasks except HumanEval and CommonsenseQA, we train the\nLLMsfor3epochswithabatchsizeof256,alearningrateof2e-5,aweightdecayof1e-2andbf16\nprecision. Weuseacosineschedulerwith10%warm-upsteps. ForHumanEvalwhichweonlyuse\n6.4ksamplestotrain,weadopt4trainingepochs,asmallerbatchsizeof192andalowerlearning\nrateof1e-5. ForCommonsenseQA,weadopt2trainingepochsandalowerlearningrateof1e-5,\ngiventhatthedatapointsinthistaskaremuchshorterthanthoseinothertasks. SimilartoRozie`re\net al. (2023), we adopt a cosine scheduler with 15% warm-up steps and set the final learning rate\nto be 25% of the peak learning rate. We do not apply loss masking to the instruction for all tasks\nexceptforCommonsenseQA,astheoutputforCommonsenseQAconsistsofonlyafewtokens.\nC EVALUATION STRATEGIES\nC.1 PROMPTSFORDOWNSTREAMTASKS\nHumanEval:\n[INST] You are an expert Python programmer, complete the function\nbelow based on its docstring and the given test cases:\n{Question}\nYour code should start with a [PYTHON] tag and end with a\n[/PYTHON] tag. [/INST]\nMBPP:\n[INST] You are an expert Python programmer, and here is your task:\n{Question}\nYour code should pass these tests:\n{Test Cases}\nYour code should start with a [PYTHON] tag and end with a\n[/PYTHON] tag. [/INST]\nGSM8kandMATH:\n[INST] You are expert at solving math problems that require\nmulti-step reasoning, and here is your task:\n{Question} [/INST] Let’s think step by step.\nCommonsenseQA: [INST] You are expert at commonsense reasoning, and\nhere is your task: {Question}\nA. {Text of Label A}\nB. {Text of Label B}\nC. {Text of Label C}\n13",
"D. {Text of Label D}\nE. {Text of Label E} [/INST] The answer is:\nC.2 DECODINGSTRATEGIES\nFor code completion tasks, to ensure comparable evaluations, we follow Rozie`re et al. (2023) and\nreportthepass@1scoresofourmodelswithinthesettingsofgreedydecodingandzero-shot.\nFor math tasks, to ensure comparable evaluations, we follow Luo et al. (2023a) and report the\npass@1scoresofourmodelswithinthesettingsofgreedydecoding,zero-shotandchain-of-thought.\nForCommonsenseQA,theabsenceofanavailabletestsetnecessitatestheevaluationofourmodel\nonthedevelopmentset. ThisevaluationisconductedwithinaframeworkadaptedfromHendrycks\netal.(2020),andisexecutedinazero-shotandanswer-onlymanner. Toensureanequitablecom-\nparison,wealsoevaluateotherLLAMA2basemodelsunderthissetting.\nD FINE-TUNING DATA FORMATS FOR ADA-INSTRUCT\nD.1 STEP1\nHumanEval:\n[INST] You are an expert Python programmer, complete the function\nbelow based on its docstring and the given test cases:\n{Question}\nYour code should start with a [PYTHON] tag and end with a\n[/PYTHON] tag. [/INST] [PYTHON]\n# pass\n[/PYTHON]\nMBPP:\n[INST] You are an expert Python programmer, and here is your task:\n{Question}\nYour code should pass these tests:\n{Test Cases}\nYour code should start with a [PYTHON] tag and end with a\n[/PYTHON] tag. [/INST] [PYTHON]\n# pass\n[/PYTHON]\nGSM8kandMATH:\n[INST] You are expert at solving math problems that require\nmulti-step reasoning, and here is your task:\n{Question} [/INST] Let’s think step by step.\nCommonsenseQA:\n[INST] You are expert at commonsense reasoning, and here is your\ntask: {Question}\nA. {Text of Label A}\nB. {Text of Label B}\nC. {Text of Label C}\nD. {Text of Label D}\nE. {Text of Label E} [/INST]\nD.2 STEP3\nHumanEval:\n[INST] You are an expert Python programmer, complete the function\nbelow based on its docstring and the given test cases:\n14",
"{Question}\nYour code should start with a [PYTHON] tag and end with a\n[/PYTHON] tag. [/INST] [PYTHON]\n{Output}\n[/PYTHON]\nMBPP:\n[INST] You are an expert Python programmer, and here is your task:\n{Question}\nYour code should pass these tests:\n{Test Cases}\nYour code should start with a [PYTHON] tag and end with a\n[/PYTHON] tag. [/INST] [PYTHON]\n{Output}\n[/PYTHON]\nGSM8kandMATH:\n[INST] You are expert at solving math problems that require\nmulti-step reasoning, and here is your task:\n{Question} [/INST] Let’s think step by step.\n{Output}\nCommonsenseQA:\n[INST] You are expert at commonsense reasoning, and here is your\ntask: {Question}\nA. {Text of Label A}\nB. {Text of Label B}\nC. {Text of Label C}\nD. {Text of Label D}\nE. {Text of Label E} [/INST] The answer is: {Output}\nE PROMPTS FOR SELF-INSTRUCT\nTo encourage high quality and diverse instruction generated, we use the following prompts in the\nSelf-Instructbaseline:\nHumanEval:\nYou are asked to come up with a set of 20 diverse instructions on\ncode completion task. These instructions will be given to a Codex\nmodel and we will evaluate the Codex model for generating codes\nthat follow the instructions.\nHere are the requirements:\n1. The instructions are designed for testing the Python\nprogramming capability to solve Python problems. Each instruction\nshould describe a Python problem with function definition,\ndocstring, and test cases.\n2. The instructions should incorporate as many Python concepts as\npossible, as well as being diverse and comprehensive.\n3. The instructions should not be too easy. Each Python problem\nshould be solved using built-in libraries or data structures with\nalgorithm of intermediate level.\n4. The instructions should at least 1 to 2 sentences long.\nEither an imperative sentence or a question is permitted.\n5. The output should be an appropriate response to the\ninstruction, and should take full account of requirements and test\ncases in the instruction.\n6. The instructions must not appear in mainstream evaluation\ndatasets for code generation, e.g. HumanEval, MBPP, DS1000 and\n15",
"so on.\nList of 20 tasks:\n###\n1. {Example 1}\n###\n2. {Example 2}\n###\n3. {Example 3}\n###\n4.\nMBPP:\nYou are asked to come up with a set of 20 diverse instructions on\ncode completion task. These instructions will be given to a Codex\nmodel and we will evaluate the Codex model for generating codes\nthat follow the instructions.\nHere are the requirements:\n1. The instructions are designed for testing the Python\nprogramming capability to solve basic Python problems. Each\ninstruction should have a clear and distinct solution.\n2. The instructions should incorporate as many Python concepts as\npossible, as well as being diverse and comprehensive.\n3. The instructions should not be too complicated or too easy.\nEach Python problem should be solved using built-in libraries or\ndata structures with algorithm of intermediate level.\n4. The instructions should at least 1 to 2 sentences long.\nEither an imperative sentence or a question is permitted.\n5. The output should be an appropriate response to the\ninstruction, and should take full account of requirements and test\ncases in the instruction.\n6. The instructions must not appear in mainstream evaluation\ndatasets for code generation, e.g. HumanEval, MBPP, DS1000 and\nso on.\nList of 20 tasks:\n###\n1. {Example 1}\n###\n2. {Example 2}\n###\n3. {Example 3}\n###\n4.\nGSM8k:\nYou are asked to come up with a set of 20 diverse instructions on\nmath problem solving task. These instructions will be given to\na math model and we will evaluate the math model for generating\nsolutions that follow the instructions.\nHere are the requirements:\n1. The instructions are designed for testing the math capability\nto solve math problems that require multi-step reasoning. Each\ninstruction should be accompanied by a detailed reasoning path and\na final answer.\n2. The instructions should include diverse types of grade school\nmath problems, as well as being diverse and comprehensive.\n3. The instructions should not be too complicated or too easy.\n16",
"Each math problem should take between 2 and 8 steps to solve, and\nsolutions primarily involve performing calculations using basic\narithmetic operations (+ - / *) to reach the final answer.\n4. The instructions should at least 1 to 2 sentences long.\nEither an imperative sentence or a question is permitted.\n5. The output should be an appropriate response to the\ninstruction that is in the form of reasoning followed by the final\nanswer.\n6. The instructions must not appear in mainstream evaluation\ndatasets for math, e.g. GSM8K, MATH and so on.\nList of 20 tasks:\n###\n1. {Example 1}\n###\n2. {Example 2}\n###\n3. {Example 3}\n###\n4.\nMATH:\nYou are asked to come up with a set of 20 diverse instructions on\nmath problem solving task. These instructions will be given to\na math model and we will evaluate the math model for generating\nsolutions that follow the instructions.\nHere are the requirements:\n1. The instructions are designed for testing the math capability\nto solve math problems that require multi-step reasoning. Each\ninstruction should be accompanied by a detailed reasoning path and\na final answer.\n2. The instructions should describe math problems in LaTex\nthat require knowledge such as calculus, algebra, number theory,\ncounting and probability, etc.\n3. The instructions should be challenging, diverse and\ncomprehensive. Each math problem should take multiple steps of\ncomplex reasoning maybe with some advanced mathematical knowledge\nand tools to solve.\n4. The instructions should at least 1 to 2 sentences long.\nEither an imperative sentence or a question is permitted.\n5. The output should be an appropriate response to the\ninstruction that is in the form of reasoning followed by the final\nanswer. Both the reasoning and answer should be in the form of\nLaTex. The final answer should be placed in \"$\nboxed{}$\".\n6. The instructions must not appear in mainstream evaluation\ndatasets for math, e.g. GSM8K, MATH and so on.\nList of 20 tasks:\n###\n1. {Example 1}\n###\n2. {Example 2}\n###\n3. {Example 3}\n###\n4.\n17"
] |
|
[{"src":"https://datasets-server.huggingface.co/assets/davanstrien/arxiv-pdfs/--/{dataset_git_revisi(...TRUNCATED) | ["Generative AI Research\nDissecting Human and LLM Preferences\nJunlongLi1,4 FanZhou1,2,4 ShichaoSun(...TRUNCATED) |
[{"src":"https://datasets-server.huggingface.co/assets/davanstrien/arxiv-pdfs/--/{dataset_git_revisi(...TRUNCATED) | ["“I’M IN THE BLUESKY TONIGHT”: INSIGHTS FROM A YEAR\nWORTH OF SOCIAL DATA\nAndreaFailla1,2∗(...TRUNCATED) |
[{"src":"https://datasets-server.huggingface.co/assets/davanstrien/arxiv-pdfs/--/{dataset_git_revisi(...TRUNCATED) | ["MAGPIE: Alignment Data Synthesis from Scratch by\nPrompting Aligned LLMs with Nothing\nZhangchenXu(...TRUNCATED) |
[{"src":"https://datasets-server.huggingface.co/assets/davanstrien/arxiv-pdfs/--/{dataset_git_revisi(...TRUNCATED) | ["Industrial Language-Image Dataset (ILID):\nAdapting Vision Foundation Models for Industrial Settin(...TRUNCATED) |
[{"src":"https://datasets-server.huggingface.co/assets/davanstrien/arxiv-pdfs/--/{dataset_git_revisi(...TRUNCATED) | ["WILDVISION: Evaluating Vision-Language Models\nin the Wild with Human Preferences\nYujieLu♠ Dong(...TRUNCATED) |
[{"src":"https://datasets-server.huggingface.co/assets/davanstrien/arxiv-pdfs/--/{dataset_git_revisi(...TRUNCATED) | ["Instruction Pre-Training:\nLanguage Models are Supervised Multitask Learners\nDaixuanCheng† Yuxi(...TRUNCATED) |
[{"src":"https://datasets-server.huggingface.co/assets/davanstrien/arxiv-pdfs/--/{dataset_git_revisi(...TRUNCATED) | ["The FineWeb Datasets: Decanting the Web for the\nFinest Text Data at Scale\nGuilhermePenedo HynekK(...TRUNCATED) |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 50