630 likes | 731 Views
An Introduction to Structural SVMs and its Application to Information Retrieval. Yisong Yue Carnegie Mellon University. x. y. 7.3. x. x. y. y. 1. -1.
E N D
An Introduction to Structural SVMs and its Application to Information Retrieval Yisong Yue Carnegie Mellon University
x y 7.3 x x y y 1 -1 Microsoft announced today that they acquired Apple for the amount equal to the gross national product of Switzerland. Microsoft officials stated that they first wanted to buy Switzerland, but eventually were turned off by the mountains and the snowy winters… GATACAACCTATCCCCGTATATATATTCTATGGGTATAGTATTAAATCAATACAACCTATCCCCGTATATATATTCTATGGGTATAGTATTAAATCAATACAACCTATCCCCGTATATATATTCTATGGGTATAGTATTAAATCAGATACAACCTATCCCCGTATATATATTCTATGGGTATAGTATTAAATCACATTTA Supervised Learning • Find function from input space X to output space Y such that the prediction error is low.
x The rain wet the cat y Det V Det N N Examples of Complex Output Spaces • Part-of-Speech Tagging • Given a sequence of words x, predict sequence of tags y. • Dependencies from tag-tag transitions in Markov model. • Similarly for other sequence labeling problems, e.g., RNA Intron/Exon Tagging.
x The dog chased the cat y S NP VP NP Det N V Det N Examples of Complex Output Spaces • Natural Language Parsing • Given a sequence of words x, predict the parse tree y. • Dependencies from structural constraints, since y has to be a tree.
Examples of Complex Output Spaces • Information Retrieval • Given a query x, predict a ranking y. • Dependencies between results (e.g. avoid redundant hits) • Loss function over rankings (e.g. Average Precision) y x • Kernel-Machines • SVM-Light • Learning with Kernels • SV Meppen Fan Club • Service Master & Co. • School of Volunteer Management • SV Mattersburg Online • … SVM
Examples of Complex Output Spaces • Multi-label Prediction • Protein Sequence Alignment • Noun Phrase Co-reference Clustering • Rankings in Information Retrieval • Inference in Graphical Models • …and many more.
1st Order Sequence Labeling • Given: • scoring function S(x, y1, y2) • input example x = (x1,…,xn) • Finds sequence y = (y1,…,yn) to maximize • Solved with dynamic programming (Viterbi) “Hypothesis Function”
Some Formulation Restrictions • Assume S is parameterized linearly by some weight vector w in RD. • This means that “Hypothesis Function”
Joint Feature Map • From last slide: • Joint feature map: • Our hypothesis function: “Linear Discriminant Function”
Structured Prediction Learning Problem • Efficient Inference/Prediction • Viterbi in sequence labeling • CKY Parser for parse trees • Belief Propagation for Markov random fields • Sorting for ranking • Efficient Learning/Training • Learn parameters w from training data {xi,yi}i=1..N • Solution: use Structural SVM framework • Can also use Perceptrons, CRFs, MEMMs, M3Ns etc.
Conventional SVMs Input: x (high dimensional point) Target: y (either +1 or -1) Prediction: sign(wTx) Training: subject to: The sum of slacks upper bounds the 0/1 loss!
Structural SVM Let x denote a structured input (sentence) Let y denote a structured output (POS tags) Standard objective function: Constraints are defined for each incorrect labeling y’ over each x. Score(y(i)) Score(y’) Loss(y’) Slack [Tsochantaridis et al., 2005]
Interpreting Constraints Suppose for incorrect y’: Then: Score(y(i)) Score(y’) Loss(y’) Slack [Tsochantaridis et al., 2005]
Adapting to Sequence Labeling • Minimize subject to where and • Sum of slacks upper bound loss. Too many constraints!
Structural SVM Training • The trick is to not enumerate all constraints. • Suppose we only solve the SVM objective over a small subset of constraints (working set). • This is efficient • Equivalent to solving standard SVM. • But some constraints from global set might be violated.
Structural SVM Training • STEP 1: Solve the SVM objective function using only working set of constraints W. • STEP 2: Using the model learned in STEP 1, find the most violated constraint from the global set of constraints. • STEP 3: If the constraint returned in STEP 2 is violated by more than ε, add it to W. • Repeat STEP 1-3 until no additional constraints are added. Return the most recent model that was trained in STEP 1. STEP 1-3 is guaranteed to loop for at most O(1/epsilon) iterations. [Joachims et al., 2009] *This is known as a “cutting plane” method.
Original SVM Problem Exponential constraints Most are dominated by a small set of “important” constraints Structural SVM Approach Repeatedly finds the next most violated constraint… …until set of constraints is a good approximation. Illustrative Example *This is known as a “cutting plane” method.
Original SVM Problem Exponential constraints Most are dominated by a small set of “important” constraints Structural SVM Approach Repeatedly finds the next most violated constraint… …until set of constraints is a good approximation. Illustrative Example *This is known as a “cutting plane” method.
Original SVM Problem Exponential constraints Most are dominated by a small set of “important” constraints Structural SVM Approach Repeatedly finds the next most violated constraint… …until set of constraints is a good approximation. Illustrative Example *This is known as a “cutting plane” method.
Original SVM Problem Exponential constraints Most are dominated by a small set of “important” constraints Structural SVM Approach Repeatedly finds the next most violated constraint… …until set of constraints is a good approximation. Illustrative Example *This is known as a “cutting plane” method.
Finding Most Violated Constraint • A constraint is violated when • Finding most violated constraint reduces to • Highly related to inference: “Loss augmented inference”
Sequence Labeling Revisited • Finding most violated constraint… … can be solved using Viterbi!
Structural SVM Recipe • Joint feature map • Inference method • Loss function • Loss-augmented (most violated constraint)
Structural SVMs for Rankings • Predicting rankings important in IR • Must provide the four ingredients: • How to represent joint feature map Ψ? • How to perform inference? • What loss function to optimize for? • How to find most violated constraint?
Joint Feature Map for Ranking • Let x = (x1,…xn) denote candidate documents • Let yjk = {+1, -1} encode pairwise rank orders • Feature map is pairwise feature difference of documents. • Inference made by sorting on document scores wTxi
Multivariate Loss Functions • Information Retrieval focused on ranking-centric performance measures • Normalized Discounted Cumulative Gain • Precision @ K • Mean Average Precision • Expected Reciprocal Rank • These measures all depend on the entire ranking
Multivariate Loss Functions • Information Retrieval focused on ranking-centric performance measures • Normalized Discounted Cumulative Gain • Precision @ K • Mean Average Precision • Expected Reciprocal Rank • These measures all depend on the entire ranking
Mean Average Precision Consider rank position of each relevant doc K1, K2, … KR Compute Precision@K for each K1, K2, … KR Average precision = average of P@K Ex: has AvgPrec of MAP is Average Precision across multiple queries/rankings
Structural SVM for MAP Minimize subject to where ( yjk= {-1, +1} ) and Sum of slacks is smooth upper bound on MAP loss. [Yue et al., SIGIR 2007]
Too Many Constraints! For Average Precision, the true labeling is a ranking where the relevant documents are all ranked in the front, e.g., An incorrect labeling would be any other ranking, e.g., This ranking has Average Precision of about 0.8 with (y’) ≈ 0.2 Intractable number of rankings, thus an intractable number of constraints!
Finding Most Violated Constraint Observations MAP is invariant on the order of documents within a relevance class Swapping two relevant or non-relevant documents does not change MAP. Joint SVM score is optimized by sorting by document score,wTxj Reduces to finding an interleaving between two sorted lists of documents [Yue et al., SIGIR 2007]
Finding Most Violated Constraint Start with perfect ranking Consider swapping adjacent relevant/non-relevant documents ► [Yue et al., SIGIR 2007]
Finding Most Violated Constraint Start with perfect ranking Consider swapping adjacent relevant/non-relevant documents Find the best feasible ranking of the non-relevant document ► [Yue et al., SIGIR 2007]
Finding Most Violated Constraint Start with perfect ranking Consider swapping adjacent relevant/non-relevant documents Find the best feasible ranking of the non-relevant document Repeat for next non-relevant document ► [Yue et al., SIGIR 2007]
Finding Most Violated Constraint Start with perfect ranking Consider swapping adjacent relevant/non-relevant documents Find the best feasible ranking of the non-relevant document Repeat for next non-relevant document Never want to swap past previous non-relevant document ► [Yue et al., SIGIR 2007]
Finding Most Violated Constraint Start with perfect ranking Consider swapping adjacent relevant/non-relevant documents Find the best feasible ranking of the non-relevant document Repeat for next non-relevant document Never want to swap past previous non-relevant document Repeat until all non-relevant documents have been considered ► [Yue et al., SIGIR 2007]
Need for Diversity (in IR) Ambiguous Queries Different information needs using same query “Jaguar” At least one relevant result for each information need Learning Queries User interested in “a specific detail or entire breadth of knowledge available” [Swaminathan et al., 2008] Results with high information diversity
Choose top 3 documents • Individual Relevance: D3 D4 D1 • Greedy Coverage Solution: D3 D1 D5
Choose top 3 documents • Individual Relevance: D3 D4 D1 • Greedy Coverage Solution: D3 D1 D5
Choose top 3 documents • Individual Relevance: D3 D4 D1 • Greedy Coverage Solution: D3 D1 D5
Choose top 3 documents • Individual Relevance: D3 D4 D1 • Greedy Coverage Solution: D3 D1 D5
Choose top 3 documents • Individual Relevance: D3 D4 D1 • Greedy Coverage Solution: D3 D1 D5
Choose top 3 documents • Individual Relevance: D3 D4 D1 • Greedy Coverage Solution: D3 D1 D5
Choose top 3 documents • Individual Relevance: D3 D4 D1 • Greedy Coverage Solution: D3 D1 D5
Example Document Word Counts Marginal Benefit
Example Document Word Counts Marginal Benefit
Prior Work • Essential Pages [Swaminathan et al., 2008] • Uses fixed function of word benefit • Depends on word frequency in candidate set • - Local version of TF-IDF • - Frequent words low weight • (not important for diversity) • - Rare words low weight • (not representative)
Joint Feature Map • x = (x1,x2,…,xn) - candidate documents • y – subset of x • V(y) – union of words from documents in y. • Joint feature map: • (v,x) – frequency features (e.g., >10%, >20%, etc). • Benefit of covering word v is thenwT(v,x) [Yue & Joachims, ICML 2008]