Count-Based Frequency Estimation with Bounded Memory

Total Page:16

File Type:pdf, Size:1020Kb

Count-Based Frequency Estimation with Bounded Memory Proceedings of the Twenty-Fourth International Joint Conference on Artificial Intelligence (IJCAI 2015) Count-Based Frequency Estimation With Bounded Memory Marc G. Bellemare Google DeepMind London, United Kingdom [email protected] Abstract estimators [Cleary and Witten, 1984; Willems et al., 1995; Tziortziotis et al., 2014]. Count-based estimators are a fundamental building We are interested in the large alphabet setting as it natu- block of a number of powerful sequential predic- rally lends itself to the compression of language data, where tion algorithms, including Context Tree Weighting symbols consist of letters, phonemes, words or even sentence and Prediction by Partial Matching. Keeping exact fragments. This setting is also of practical interest in rein- counts, however, typically results in a high memory forcement learning, for example in learning dynamical mod- overhead. In particular, when dealing with large al- els for planning [Farias et al., 2010; Bellemare et al., 2013]. phabets the memory requirements of count-based In both contexts, the statistical efficiency of count-based es- estimators often become prohibitive. In this pa- timators makes them excellent modelling candidates. How- per we propose three novel ideas for approximat- ever, the memory demands of such estimators typically in- ing count-based estimators using bounded mem- crease linearly with the effective alphabet size , which is ory. Our first contribution, of independent inter- M problematic when grows with the sequence length. Per- est, is an extension of reservoir sampling for sam- M haps surprisingly, this issue is more than just a theoretical pling distinct symbols from a stream of unknown concern and often occurs in language data [Gale and Church, length, which we call K-distinct reservoir sam- 1990]. pling. We combine this sampling scheme with a state-of-the-art count-based estimator for memory- Our work is also motivated by the desire to improve the less sources, the Sparse Adaptive Dirichlet (SAD) Context Tree Weighting algorithm [CTW; Willems et al., estimator. The resulting algorithm, the Budget 1995] to model k-Markov large alphabet sources. While SAD, naturally guarantees a limit on its memory CTW is a powerful modelling technique, its practical mem- usage. We finally demonstrate the broader use of ory requirements (linear in the size of the sequence) often pre- K-distinct reservoir sampling in nonparametric es- clude its use in large problems. Here, even when the alphabet timation by using it to restrict the branching fac- size is fixed and small, the number of observed k-order con- tor of the Context Tree Weighting algorithm. We texts typically grows with the sequence length. We are par- demonstrate the usefulness of our algorithms with ticularly interested in reducing the long term memory usage empirical results on two sequential, large-alphabet of such an estimator, for example when estimating attributes prediction problems. of internet packets going through a router or natural language models trained on nonstationary data. Our solution takes its inspiration from the reservoir sam- 1 Introduction pling algorithm [Knuth, 1981] and the work of Dekel et al. Undoubtedly, counting is the simplest way of estimating the [2008] on budget perceptrons. We propose an online, ran- relative frequency of symbols in a data sequence. In the se- domized algorithm for sampling distinct symbols from a data quential prediction setting, these estimates are used to assign stream; by choosing a sublinear reservoir size, we effectively to each symbol a probability proportionate to its frequency. force our statistical estimator to forget infrequent symbols. When dealing with binary alphabets the counting approach We show that this algorithm can easily be combined with a gives rise to the Krichevsky-Trofimov estimator, known to be typical count-based estimator, the Sparse Adaptive Dirich- minmax optimal [Krichevsky and Trofimov, 1981]. Count- let estimator, to guarantee good statistical estimation while based approaches are also useful in dealing with large alpha- avoiding unbounded memory usage. As our results demon- bets, and a number of methods coexist [Katz, 1987; Tjalkens strate, the resulting estimator is best suited to sources that et al., 1993; Friedman and Singer, 1999; Hutter, 2013], emit a few frequent symbols while also producing a large pool each with its own statistical assumptions and regret proper- of low-frequency “noise”. We further describe a simple ap- ties. While these simple estimators deal only with mem- plication of our sampling algorithm to branch pruning within oryless sources – whose output is context invariant – they the CTW algorithm. play a critical role as building blocks for more complicated The idea of sampling distinct symbols from a stream is 3337 well-studied in the literature. Perhaps most related to ours conditional probabilities according to is the work of Gibbons and Matias [1998], who proposed the ρ(x1:tx) notion of a concise sample to more efficiently store a “hot ρ(x x1:t) := ; list” of frequent elements. Their algorithm is also based on j ρ(x1:t) reservoir sampling, but relies on a user-defined threshold and which after rearrangement yields the familiar chain rule Qn probabilistic counting. By contrast, our algorithm maintains ρ(x1:n) := ρ(xt x1:t−1). t=1 j a reservoir based on a random permutation of the data stream, A source is a distinguished type of coding distribution which avoids the need for a threshold. Gibbons [2001] pro- which we assume generates sequences. When a coding dis- posed an algorithm called Distinct Sampling to estimate the tribution is not a source, we call it a model. A source number of distinct values within a data stream. Similar to (µt : t N) is said to be memoryless when µt(x x1:t) = 2 j the hot list algorithm, Distinct Sampling employs a growing µt(x ) =: µt(x) for all t, all x , and all sequences j t 2 X P threshold, which is used to determine when infrequent sym- x1:t ; for , we then write µt( ) := µt(x). 2 X B ⊆ X B x2B bols should be discarded. Metwally et al. [2005] proposed When µt(x) := µ1(x) for all t, we say it is stationary and to track frequent symbols using a linked list and a hash table. omit its subscript. Their Space Saving algorithm aims to find all frequently oc- Let x n and let µ be an unknown coding distribu- 1:n 2 X curring items (heavy hitters), rather than provide a frequency- tion, for example the source that generates x1:n. We define biased sample; a similar scheme was also proposed by De- the redundancy of a model ρ with respect to µ as et al. [ ] [ ] maine 2002 . Manku and Motwani 2002 proposed a ρ(x1:n) probabilistic counting and halving approach to find all items Fn(ρ, µ) := F(ρ, µ, x1:n) := log : − µ(x ) whose frequency is above a user-defined threshold. Charikar 1:n et al. [2004] showed how to use a probabilistic count sketch The redundancy Fn(ρ, µ) can be interpreted as the excess bits in order to find frequent items in a data stream. While count (or nats) required to encode x1:n using ρ rather than µ. The sketches may seem the natural fit for count-based estimators, expectation of this redundancy with respect to a random se- quence x is the Kullback-Leibler divergence KL (µ ρ): their memory requirements grow quadratically with the accu- 1:n n k racy parameter ; by contrast, our algorithm has only a linear KLn(µ ρ) := E [Fn(ρ, µ)] : dependency on the implied . k x1:n∼µ Typically, we are interested in how well ρ compares to a class of coding distributions . The redundancy of ρ with respect 2 Background to this class is definedM as M 0 Fn(ρ, ) := max Fn(ρ, ρ ): In the sequential prediction setting we consider, an algorithm M ρ02M must make probabilistic predictions over a sequence of sym- Intuitively, F (ρ, ) measures the cost of encoding x bols observed one at a time. These symbols belong to a finite n M 1:n n with ρ rather than the best model in . alphabet , with x1:n := x1 : : : xn denoting a string M X 2 X drawn from this alphabet. A probabilistic prediction consists 2.1 The Sparse Adaptive Dirichlet Estimator in assigning a probability to a new symbol xn+1 given that The Sparse Adaptive Dirichlet estimator [SAD; Hutter, 2013] x1:n has been observed. is a count-based frequency estimator designed for large- Let [n] := 1; : : : ; n . We denote the set of finite strings alphabet sources with sparse support. Informally, the SAD by ∗ := Sf1 i, denoteg the concatenation of strings s X i=0 X predicts according to empirical frequencies in x1:n, while re- and r by sr, and use to represent the empty string. For serving some escape probability γ for unseen symbols. Given a set , we write x1:n := (xi : i [n]; xi = ) St B ⊆ X n B 2 2 B t := i=1 xi the set of symbols seen up to time t and a to denote the substring produced by excising from x1:n the probabilityA distributionf g w over , the SAD estimator symbols in . We denote by N (x) := N(x; x ) the t X n At B n 1:n predicts according to number of occurrences of x within x1:n, and write ( for the time2X of first occurrence of in Nt(x) if x ; τn(x) := τ(x; x1:n) x SAD t+γt t ρ (x x1:t) := 2 A x1:n, with τ(x; x1:n) := n + 1 whenever x = x1:n. We de- j γtwt(x) otherwise. note the set of permutations of x by (x 2 ) and the dis- t+γt 1:n P 1:n 8 crete uniform distribution over by UX ( ).
Recommended publications
  • Short and Deep: Sketching and Neural Networks
    SHORT AND DEEP: SKETCHING AND NEURAL NETWORKS Amit Daniely, Nevena Lazic, Yoram Singer, Kunal Talwar∗ Google Brain ABSTRACT Data-independent methods for dimensionality reduction such as random projec- tions, sketches, and feature hashing have become increasingly popular in recent years. These methods often seek to reduce dimensionality while preserving the hypothesis class, resulting in inherent lower bounds on the size of projected data. For example, preserving linear separability requires Ω(1/γ2) dimensions, where γ is the margin, and in the case of polynomial functions, the number of required di- mensions has an exponential dependence on the polynomial degree. Despite these limitations, we show that the dimensionality can be reduced further while main- taining performance guarantees, using improper learning with a slightly larger hypothesis class. In particular, we show that any sparse polynomial function of a sparse binary vector can be computed from a compact sketch by a single-layer neu- ral network, where the sketch size has a logarithmic dependence on the polyno- mial degree. A practical consequence is that networks trained on sketched data are compact, and therefore suitable for settings with memory and power constraints. We empirically show that our approach leads to networks with fewer parameters than related methods such as feature hashing, at equal or better performance. 1 INTRODUCTION In many supervised learning problems, input data are high-dimensional and sparse. The high di- mensionality may be inherent in the domain, such as a large vocabulary in a language model, or the result of creating hybrid conjunction features. This setting poses known statistical and compu- tational challenges for standard supervised learning techniques, as high-dimensional inputs lead to models with a very large number of parameters.
    [Show full text]
  • Fast and Scalable Polynomial Kernels Via Explicit Feature Maps *
    Fast and Scalable Polynomial Kernels via Explicit Feature Maps * Ninh Pham Rasmus Pagh IT University of Copenhagen IT University of Copenhagen Copenhagen, Denmark Copenhagen, Denmark [email protected] [email protected] ABSTRACT data space into high-dimensional feature space, where each Approximation of non-linear kernels using random feature coordinate corresponds to one feature of the data points. In mapping has been successfully employed in large-scale data that space, one can perform well-known data analysis al- analysis applications, accelerating the training of kernel ma- gorithms without ever interacting with the coordinates of chines. While previous random feature mappings run in the data, but rather by simply computing their pairwise in- O(ndD) time for n training samples in d-dimensional space ner products. This operation can not only avoid the cost and D random feature maps, we propose a novel random- of explicit computation of the coordinates in feature space ized tensor product technique, called Tensor Sketching, for but also handle general types of data (such as numeric data, approximating any polynomial kernel in O(n(d + D log D)) symbolic data). time. Also, we introduce both absolute and relative error While kernel methods have been used successfully in a va- bounds for our approximation to guarantee the reliability riety of data analysis tasks, their scalability is a bottleneck. of our estimation algorithm. Empirically, Tensor Sketching Kernel-based learning algorithms usually scale poorly with achieves higher accuracy and often runs orders of magni- the number of the training samples (a cubic running time tude faster than the state-of-the-art approach for large-scale and quadratic storage for direct methods).
    [Show full text]
  • Learning-Based Frequency Estimation Algorithms
    Published as a conference paper at ICLR 2019 LEARNING-BASED FREQUENCY ESTIMATION ALGORITHMS Chen-Yu Hsu, Piotr Indyk, Dina Katabi & Ali Vakilian Computer Science and Artificial Intelligence Lab Massachusetts Institute of Technology Cambridge, MA 02139, USA fcyhsu,indyk,dk,[email protected] ABSTRACT Estimating the frequencies of elements in a data stream is a fundamental task in data analysis and machine learning. The problem is typically addressed using streaming algorithms which can process very large data using limited storage. Today’s streaming algorithms, however, cannot exploit patterns in their input to improve performance. We propose a new class of algorithms that automatically learn relevant patterns in the input data and use them to improve its frequency estimates. The proposed algorithms combine the benefits of machine learning with the formal guarantees available through algorithm theory. We prove that our learning-based algorithms have lower estimation errors than their non-learning counterparts. We also evaluate our algorithms on two real-world datasets and demonstrate empirically their performance gains. 1.I NTRODUCTION Classical algorithms provide formal guarantees over their performance, but often fail to leverage useful patterns in their input data to improve their output. On the other hand, deep learning models are highly successful at capturing and utilizing complex data patterns, but often lack formal error bounds. The last few years have witnessed a growing effort to bridge this gap and introduce al- gorithms that can adapt to data properties while delivering worst case guarantees. Deep learning modules have been integrated into the design of Bloom filters (Kraska et al., 2018; Mitzenmacher, 2018), caching algorithms (Lykouris & Vassilvitskii, 2018), graph optimization (Dai et al., 2017), similarity search (Salakhutdinov & Hinton, 2009; Weiss et al., 2009) and compressive sensing (Bora et al., 2017).
    [Show full text]
  • Incremental Randomized Sketching for Online Kernel Learning
    Incremental Randomized Sketching for Online Kernel Learning Xiao Zhang 1 Shizhong Liao 1 Abstract updating time significantly (Wang et al., 2012). To solve the Randomized sketching has been used in offline problem, budgeted online kernel learning has been proposed kernel learning, but it cannot be applied directly to to maintain a buffer of support vectors (SVs) with a fixed online kernel learning due to the lack of incremen- budget, which limits the model size to reduce the computa- tal maintenances for randomized sketches with tional complexities (Crammer et al., 2003). Several budget regret guarantees. To address these issues, we maintenance strategies were introduced to bound the buffer propose a novel incremental randomized sketch- size of SVs. Dekel et al.(2005) maintained the budget by ing approach for online kernel learning, which discarding the oldest support vector. Orabona et al.(2008) has efficient incremental maintenances with theo- projected the new example onto the linear span of SVs in retical guarantees. We construct two incremental the feature space to reduce the buffer size. But the buffer of randomized sketches using the sparse transform SVs cannot be used for kernel matrix approximation directly. matrix and the sampling matrix for kernel ma- Besides, it is difficult to provide a lower bound of the buffer trix approximation, update the incremental ran- size that is key to the theoretical guarantees for budgeted domized sketches using rank-1 modifications, and online kernel learning. construct a time-varying explicit feature mapping Unlike the budget maintenance strategies of SVs, sketches for online kernel learning. We prove that the pro- of the kernel matrix have been introduced into online kernel posed incremental randomized sketching is statis- learning to approximate the kernel incrementally.
    [Show full text]
  • Compressing Gradient Optimizers Via Count-Sketches
    Compressing Gradient Optimizers via Count-Sketches Ryan Spring 1 * Anastasios Kyrillidis 1 Vijai Mohan 2 Anshumali Shrivastava 1 2 Abstract Training large-scale models efficiently is a challenging task. Many popular first-order optimization methods There are numerous publications that describe how to lever- accelerate the convergence rate of deep learning age multi-GPU data parallelism and mixed precision train- models. However, these algorithms require aux- ing effectively (Hoffer et al., 2017; Ott et al., 2018; Micike- iliary variables, which cost additional memory vicius et al., 2018). A key tool for improving training time proportional to the number of parameters in the is to increase the batch size, taking advantage of the massive model. The problem is becoming more severe as parallelism provided by GPUs. However, increasing the models grow larger to learn from complex, large- batch size also requires significant amounts of memory. A scale datasets. Our proposed solution is to main- practitioner will sometimes sacrifice their batch size for a tain a linear sketch to compress the auxiliary vari- larger, more expressive model. For example, (Puri et al., ables. Our approach has the same performance as 2018) showed that doubling the dimensionality of a mul- the full-sized baseline, while using less space for tiplicative LSTM (Krause et al., 2016) from 4096 to 8192 the auxiliary variables. Theoretically, we prove forced them to reduce the batch size per GPU by 4×. that count-sketch optimization maintains the SGD One culprit that aggravates the memory capacity issue is convergence rate, while gracefully reducing mem- the auxiliary parameters used by first-order optimization ory usage for large-models.
    [Show full text]
  • Communication-Efficient Federated Learning with Sketching
    Communication-Efficient Federated Learning with Sketching Ashwinee Panda Daniel Rothchild Enayat Ullah Nikita Ivkin Ion Stoica Joseph Gonzalez, Ed. Raman Arora, Ed. Vladimir Braverman, Ed. Electrical Engineering and Computer Sciences University of California at Berkeley Technical Report No. UCB/EECS-2020-57 http://www2.eecs.berkeley.edu/Pubs/TechRpts/2020/EECS-2020-57.html May 23, 2020 Copyright © 2020, by the author(s). All rights reserved. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission. COMMUNICATION-EFFICIENT FEDERATED LEARNING WITH SKETCHING APREPRINT 1 1 2 3† Daniel Rothchild ∗ Ashwinee Panda ∗ Enayat Ullah Nikita Ivkin Vladimir Braverman2 Joseph Gonzalez1 Ion Stoica1 Raman Arora2 1 UC Berkeley, drothchild, ashwineepanda, jegonzal, istoica @berkeley.edu 2Johns Hopkinsf University, [email protected], vova, arora @cs.jhu.edug 3 Amazon, [email protected] g ABSTRACT Existing approaches to federated learning suffer from a communication bottleneck as well as conver- gence issues due to sparse client participation. In this paper we introduce a novel algorithm, called FedSketchedSGD, to overcome these challenges. FedSketchedSGD compresses model updates using a Count Sketch, and then takes advantage of the mergeability of sketches to combine model updates from many workers. A key insight in the design of FedSketchedSGD is that, because the Count Sketch is linear, momentum and error accumulation can both be carried out within the sketch.
    [Show full text]
  • Tensors in Modern Statistical Learning 1 Introduction
    Tensors in Modern Statistical Learning Will Wei Suny, Botao Haoz, and Lexin Li∗ yPurdue University, zDeepMind, and ∗University of California at Berkeley Abstract Tensor learning is gaining increasing attention in recent years. This survey provides an overview of tensor analysis in modern statistical learning. It consists of four main topics, including tensor supervised learning, tensor unsupervised learning, tensor reinforcement learning, and tensor deep learning. This review emphasizes statistical models and properties, as well as connections between tensors and other learning topics such as reinforcement learning and deep learning. Keywords: Tensor decomposition; Tensor regression; Tensor clustering; Tensor graphical model; Tensor reinforcement learning; Tensor deep learning. 1 Introduction Tensors, also known as multidimensional arrays, are generalizations of vectors and matrices to higher dimensions. In recent years, tensor data are fast emerging in a wide variety of scientific and business applications, including but not limited to recommendation systems (Rendle and Schmidt-Thieme, 2010; Bi et al., 2018), speech or facial recognitions (Vasilescu and Terzopoulos, 2002; Ma et al., 2019), networks analysis (Li et al., 2011; Ermis et al., 2015), knowledge graphs and relational learning (Trouillon et al., 2017; Liu et al., 2020), among many others. Tensor data analysis is thus gaining increasing attention in statistics and machine learning communities. In this survey, we provide an overview of tensor analysis in modern statistical learning.
    [Show full text]
  • (Learned) Frequency Estimation Algorithms Under Zipfian Distribution
    (Learned) Frequency Estimation Algorithms under Zipfian Distribution Anders Aamand∗ Piotr Indyky Ali Vakilianz Abstract The frequencies of the elements in a data stream are an important statistical measure and the task of estimating them arises in many applications within data analysis and machine learning. Two of the most popular algorithms for this problem, Count-Min and Count-Sketch, are widely used in practice. In a recent work [Hsu et al., ICLR'19], it was shown empirically that augmenting Count- Min and Count-Sketch with a machine learning algorithm leads to a significant reduction of the estimation error. The experiments were complemented with an analysis of the expected error incurred by Count-Min (both the standard and the augmented version) when the input frequencies follow a Zipfian distribution. Although the authors established that the learned version of Count-Min has lower estimation error than its standard counterpart, their analysis of the standard Count-Min algorithm was not tight. Moreover, they provided no similar analysis for Count-Sketch. In this paper we resolve these problems. First, we provide a simple tight analysis of the expected error incurred by Count-Min. Second, we provide the first error bounds for both the standard and the augmented version of Count-Sketch. These bounds are nearly tight and again demonstrate an improved performance of the learned version of Count-Sketch. In addition to demonstrating tight gaps between the aforementioned algorithms, we believe that our bounds for the standard versions of Count-Min and Count-Sketch are of independent interest. In particular, it is a typical practice to set the number of hash functions in those algorithms to Θ(log n).
    [Show full text]
  • Communication-Efficient Distributed SGD with Sketching
    Communication-efficient Distributed SGD with Sketching Nikita Ivkin ∗y Daniel Rothchild ∗ Enayat Ullah ∗ Amazon UC Berkeley Johns Hopkins University [email protected] [email protected] [email protected] Vladimir Braverman z Ion Stoica Raman Arora Johns Hopkins University UC Berkeley Johns Hopkins University [email protected] [email protected] [email protected] Abstract Large-scale distributed training of neural networks is often limited by network band- width, wherein the communication time overwhelms the local computation time. Motivated by the success of sketching methods in sub-linear/streaming algorithms, we introduce SKETCHED-SGD4, an algorithm for carrying out distributed SGD by communicating sketches instead of full gradients. We show that SKETCHED-SGD has favorable convergence rates on several classes of functions. When considering all communication – both of gradients and of updated model weights – SKETCHED- SGD reduces the amount of communication required compared to other gradient compression methods from O(d) or O(W ) to O(log d), where d is the number of model parameters and W is the number of workers participating in training. We run experiments on a transformer model, an LSTM, and a residual network, demonstrating up to a 40x reduction in total communication cost with no loss in final model performance. We also show experimentally that SKETCHED-SGD scales to at least 256 workers without increasing communication cost or degrading model performance. 1 Introduction Modern machine learning training workloads are commonly distributed across many machines using data-parallel synchronous stochastic gradient descent. At each iteration, W worker nodes split a mini-batch of size B; each worker computes the gradient of the loss on its portion of the data, and then a parameter server sums each worker’s gradient to yield the full mini-batch gradient.
    [Show full text]
  • Privacy for Free: Communication-Efficient Learning
    Privacy for Free: Communication-Efficient Learning with Differential Privacy Using Sketches Tian Li Zaoxing Liu Vyas Sekar Virginia Smith CMU CMU CMU CMU [email protected] [email protected] [email protected] [email protected] Abstract Communication and privacy are two critical concerns in distributed learning. Many existing works treat these concerns separately. In this work, we argue that a natural connection exists between methods for communication reduction and privacy preservation in the context of distributed machine learning. In particular, we prove that Count Sketch, a simple method for data stream summarization, has inherent differential privacy properties.1 Using these derived privacy guarantees, we propose a novel sketch-based framework (DiffSketch) for distributed learning, where we compress the transmitted messages via sketches to simultaneously achieve communication efficiency and provable privacy benefits. Our evaluation demonstrates that DiffSketch can provide strong differential privacy guarantees (e.g., ε = 1) and reduce communication by 20-50× with only marginal decreases in accuracy. Compared to baselines that treat privacy and communication separately, DiffSketch improves absolute test accuracy by 5%-50% while offering the same privacy guarantees and communication compression. 1 Introduction Communication costs and privacy concerns are two critical challenges in performing distributed machine learning with sensitive information. Indeed, these challenges are particularly relevant for the increasingly common problem of federated learning, in which data is collected and stored across a network of devices such as mobile phones or wearable devices [29, 34]. Communicating data across such a distributed network in order to learn an aggregate model is both costly and can potentially reveal sensitive user information [10, 35].
    [Show full text]
  • Frequency Estimation in Data Streams: Learning the Optimal Hashing Scheme
    IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING, VOL. 1, NO. 1, JULY 2020 1 Frequency Estimation in Data Streams: Learning the Optimal Hashing Scheme Dimitris Bertsimas and Vassilis Digalakis Jr. Abstract—We present a novel approach for the problem of frequency estimation in data streams that is based on optimization and machine learning. Contrary to state-of-the-art streaming frequency estimation algorithms, which heavily rely on random hashing to maintain the frequency distribution of the data steam using limited storage, the proposed approach exploits an observed stream prefix to near-optimally hash elements and compress the target frequency distribution. We develop an exact mixed-integer linear optimization formulation, as well as an efficient block coordinate descent algorithm, that enable us to compute near-optimal hashing schemes for elements seen in the observed stream prefix; then, we use machine learning to hash unseen elements. We empirically evaluate the proposed approach on real-world search query data and show that it outperforms existing approaches by one to two orders of magnitude in terms of its average (per element) estimation error and by 45-90% in terms of its expected magnitude of estimation error. Index Terms—Data streams, streaming frequency estimation, learning to hash, optimal hashing scheme. F 1 INTRODUCTION E consider a streaming model of computation [1], [2], query appears in the stream, in space much smaller than the total W where the input is represented as a finite sequence of number of unique queries. elements from some finite universe (domain) which is not available for random access, but instead arrives dynamically Massive data streams appear in a variety of applications.
    [Show full text]
  • Question Type Guided Attention in Visual Question Answering
    Question Type Guided Attention in Visual Question Answering Yang Shi1 ⋆, Tommaso Furlanello2, Sheng Zha3, and Animashree Anandkumar34 1 University of California, Irvine [email protected] 2 University of Southern California [email protected] 3 Amazon AI {zhasheng},{anima}@amazon.com 4 California Institute of Technology Abstract. Visual Question Answering (VQA) requires integration of feature maps with drastically different structures. Image descriptors have structures at mul- tiple spatial scales, while lexical inputs inherently follow a temporal sequence and naturally cluster into semantically different question types. A lot of previous works use complex models to extract feature representations but neglect to use high-level information summary such as question types in learning. In this work, we propose Question Type-guided Attention (QTA). It utilizes the information of question type to dynamically balance between bottom-up and top-down vi- sual features, respectively extracted from ResNet and Faster R-CNN networks. We experiment with multiple VQA architectures with extensive input ablation studies over the TDIUC dataset and show that QTA systematically improves the performance by more than 5% across multiple question type categories such as “Activity Recognition”, “Utility” and “Counting” on TDIUC dataset compared to the state-of-art. By adding QTA on the state-of-art model MCB, we achieve 3% improvement in overall accuracy. Finally, we propose a multi-task extension to predict question types which generalizes QTA to applications that lack question type, with a minimal performance loss. Keywords: Visual question answering, Attention, Question type, Feature selec- tion, Multi-task 1 Introduction The relative maturity and flexibility of deep learning allow us to build upon the suc- cess of computer vision [17] and natural language [13, 20] to face new complex and multimodal tasks.
    [Show full text]