A task force has been convened by CATCS to investigate possible approaches to modifying aspects of the TCS community, especially our publishing culture, to enhance connections with other areas of CS and be as welcoming as possible to a broad range of contributions within theory. This committee will collect and synthesize feedback from the community via the questionnaire on https://tinyurl.com/tcs-connections then make suggestions.
Since adjusting conference formats may help with this, we would like to get a general idea of community opinion on format choices. If you have some opinions you would like to share, please use this form. Though the questions below focus primarily on FOCS/STOC, we are welcome to receiving any and all suggestions that would make the TCS community as broad and well-connected to other areas of TCS as possible (see the last question of the survey).
Task force members: Ken Clarkson (IBM Research) Sandy Irani (UC Irvine) Bobby Kleinberg (Cornell) Adam Klivans (UT Austin) Ravi Kumar (Google) Jelani Nelson (UC Berkeley) Yuval Rabani (Hebrew University)
Galileo Galileo has many self-appointed intellectual heirs these days. Whether it’s a claim that the election has been stolen, that COVID-19 is less fatal than the flu, that climate change or evolution are hoaxes, or that P=NP, we keep hearing from people considering themselves as bold truth-tellers railing against conventional wisdom. We are encouraged to “teach the debate” and that if only paid attention, we will see that their Tweet, declaration, or arxiv paper contains an irrefutable proof of their assertions.
In the words of Ted Cruz, “They brand you a heretic. Today, the global warming alarmists are the equivalent of the flat-Earthers. It used to be [that] it is accepted scientific wisdom the Earth is flat, and this heretic named Galileo was branded a denier”.
Of course by Galileo’s time it was well known that the earth was spherical, and Magellan circumnavigated the earth more than 40 years before Galileo was born. But putting aside Cruz’s confusion of flat earth and geocentrism, the story of heliocentric theory is not one of an outsider railing against the scientific mainstream. Galileo himself was a chaired professor of mathematics at the University of Padua, and later philosopher and mathematician to the grand duke of Tuscany. He was very much part of the scientific establishment of his time. Moreover, though Galileo did provide important evidence for heliocentrism, he was not the only one doing so. Kepler found a heliocentric model with elliptical orbits that actually made correct predictions, and, though it took a decade or so, Kepler’s book eventually became the standard textbook for astronomy.
My point in this post is not to rehash the history of heliocentrism or Galileo but rather to call out a misconception which, to use Sean Carrol’s phrasing, amounts to valorization of puzzle-solving over wisdom.
It is tempting to think that an argument, regardless whether it comes from an expert or a random person on Twitter, can be presented in a self-contained way and judged on its merits. However, this is not how things work in any interesting setting. Even in the case of a purported P vs NP proof, there is background knowledge on computational complexity without which it would be hard to spot holes in the argument. This is doubly so for any claim involving empirical facts, whether it’s about elections, infections, climate etc. It is not possible to evaluate such claims without context, and to get this context you need to turn to the experts that have studied the topic.
I have written before in defense of expertise (see also here) but Carroll puts it very well. Another way to say it is that the operational interpretation of the common refrain
Treat claims conforming to conventional wisdom with charity, and claims disputing it with skepticism.
(There is a question of how to define “conventional wisdom” but interestingly there is usually agreement in practice by both sides. Most “deniers” of various sorts are proud of going against conventional wisdom, but don’t acknowledge that this means they are more likely to be wrong.)
As an example, even if someone has expertise in analytic number theory, and so presumably has plenty of so-called “puzzle-solving intelligence”, that doesn’t mean that they can evaluate a statistical claim on election fraud and their analysis should be considered evidence (apparently at this point the number theorist himself agrees). We can try to read and debunk what they wrote, or we can assume that if there was evidence for large-scale fraud, then the president of the United States and his well-funded campaign would have managed to find actual statisticians and experts on election to make the case.
There can be debate if Trump’s attempt to overthrow the election should be considered as dangerous or merely absurd, but the constant attacks on the very notions of truth, science, and expertise are causing far-reaching harm.
(H/T: Scott Aaronson, who makes a similar point around the election conspiracies.)
[Guest post by Claire Vernade, Jessica Sorrell, Kamalika Chaudhuri, Lee Cohen, Mary Anne Smart, Michal Moshkovitz, and Ruth Urner. I am very happy about this initiative – mentoring and community is so important for success in science, and as I’ve written before, there is much work to do so women will have the same access to these as men. –Boaz]
Women in machine learning (or WiML for short) was established more than ten years ago, and its main goals are to 1. Increase the number of women in machine learning 2. Help women in machine learning succeed professionally 3. Increase the impact of women in machine learning in the community. Towards this goal, they create different opportunities for women to showcase their work. Chief among them is the annual Women in Machine Learning (WiML) Workshop, typically co-located with NeurIPS, which presents women’s cutting-edge research.
Women in machine learning theory (or WiML-T for short) shares the same goals as WiML but focuses on the smaller learning theory community. The vision of WiML-T is to give visibility and legitimacy to under-represented groups in learning theory, to create stronger bonds within the community and beyond, and to provide support and advice. As part of this vision, we have decided to facilitate a mentoring program that will connect women and non-binary researchers who are newer to learning theory with more experienced mentors.
Mentoring programs have been shown to greatly help underrepresented communities develop . More resources on mentoring can be found on the website of Stanford’s Women’s Leadership Innovation Lab and on our website. Mentoring creates strong bonds of trust within the community, it helps mentees find career advice and connections, and it helps mentors grow their leadership skills while keeping in touch with the newcomers of the community. We hope that creating a world-wide program will also help reduce inequality between less privileged areas and the most famous institutions. Indeed, it is a well-known fact that the more competitive a career path, the less diverse it is, due in part to network effects from which under-represented groups are excluded. We believe that uniting individuals from these groups (i.e. women, non-binary people, persons of color and other minorities) will help reduce these effects and contribute to finding solutions to the community’s problems.
Why be a mentor?
Remember the beginning of your research journey, with all the difficulties, uncertainties, and unanswered questions? This is your chance to give all the advice you wish you got, and make an impact on a future colleague. As a mentor you will be a role model and help the young generation of researchers in learning theory. You will help them develop and enhance their careers by giving them the support they need. Need more reasons to mentor? It will grow your leadership skills, self-confidence, communication skills, and you will feel happier after you help others.
Who can be a mentor?
Nearly everyone who has some experience in academia or industry can be a mentor. It can be interesting for an undergrad student to receive advice from senior PhD students or postdocs who have recently had to reflect about career decisions and can share knowledge about their work environment. We indeed expect the most senior researchers to apply as mentors, but we would also like to encourage PhDs and postdocs to consider mentoring (while possibly having a mentor as well!).
Can men mentor?
We thank everyone who wants to help the community!
We will prioritize women mentors as they can give their unique perspective, BUT, we acknowledge that there might be a limited number of mentors. To mitigate this issue, we will be happy to pair male mentors provided the mentee agrees.
Why be a mentee?
Having a mentor is one of the best ways to get external career advice, to get some feedback from someone with a possibly similar background. Managing to find one’s way into academia or science is not easy. It can be even harder for under-represented groups who may lack role models within their institution, or who may not connect with common advice that implicitly assumes or relies on some class privilege. Having a mentor can help you navigate professional and personal issues that men may not always have. It is also a way to get connected to other members of the community, or have second opinions on research strategies.
The program launched on October 29 2020 and will run on a continuous basis.
We will start with pairings of mentors and mentees in December 2020. This process can take a few months.
Frequency of the meetings: totally depends on the mentor and mentee. It can be either weekly meetings or once every two months or anything in between.
Duration of the mentorship: totally depends on the mentor and mentee. It can be a few months, a year, or even more.
Have questions? You can mail us at: firstname.lastname@example.org
 Ginther, D. K., Currie, J., Blau, F. D., & Croson, R. (2020). Can Mentoring Help Female Assistant Professors in Economics? An Evaluation by Randomized Trial. NBER Working Paper No. 26864. https://doi.org/10.3386/w26864
As explained in Boaz’s previous posts , the PhD admission process can be challenging for students who discover their passion for Theory of Computer Science late in their undergraduate studies. Discovering TCS earlier is especially challenging for students who aren’t exposed to CS in high school, and this bias aggravates the diversity issues we have in our community. Masters programs are one way to mitigate this issue. On a personal note, one of us (Aviad), worked half-time during undergraduate and would not have been in academia today -let alone TCS of all subjects- if it weren’t for the awesome TCS masters program at Tel-Aviv University.
But where would you go (or send your students) to do a masters in TCS?A little over a year ago, we were discussing how useful it would be to have a unified resource that can help students choose. We decided that we should create one! Months passed, and right before we ran out of excuses to procrastinate, Boaz made this post crowdsourcing information on TCS masters programs. After some more procrastination, we eventually did send a lot of emails and tried to clean and organize the information to the best of our ability. Thanks to everyone who contributed! You can find the latest version here. (Short url: http://tiny.cc/tcsmasters)
Now you should share it with your brightest students!
This is also meant to be a live project. Please email aviad [at] cs.stanford.edu if you have more new information or find any inaccuracies.
Election security has been studied for many years by computer scientists, but it is not as often that it attracts so much mainstream attention. I would never have expected to see my former Princeton colleague Andrew Appel on a Sean Hannity segment tweeted by President Trump.
It may seem that even if it has partisan motivations, the recent GOP interest in election security is overall a positive thing. Who wouldn’t want elections to be more secure? Who wouldn’t want less fraud? However, in a very precise sense, the definition of “election security” used by the GOP these days corresponds to election insecurity.
To understand this claim, consider what it means for an election to be secure. (Let’s focus just on the correctness aspect of the count, since it is at the heart of the current issues, and not on the very interesting privacy aspect.) Computer scientists use the technical terms “cast as intended“, “recorded as cast“, and “tallied as recorded“. In other words: if a voter X intends to cast vote for candidate Y, then this vote should be recorded and tallied, and only such votes should be tallied.
With mail-in voting, there are several potential points of failure on the path between voter intent and the final tally:
Mail can be lost or delayed too much, leading to the vote not counting.
A third party could intercept the ballot and impersonate the voter.
A ballot may not be formatted properly in some way, leading to it being disqualified.
There can be errors or hacks in the tallying process.
Election security is about combatting points 1-4 (of which the last 3 are also applicable to in-person voting) , ideally in a way that is verifiable to the individual voters. Achieving verifiability while maintaining secrecy and not requiring the voter to trust complex technology is a challenging task, but there have been some proposed solutions (see above links).
The Hannity segment and much of the “Dominion” non story focused on point 4. This is an important point, but as Appel himself notes, paper ballots, which are mostly used in the US, serve as a way to audit counting. Re-counting is important, and is commonly done, but such recounts often change the total counts by relatively little (and the changes mostly cancel out). For example, here is the list of ballots changed and reasons from the Wisconsin 2016 count (taken from this paper)
In contrast, many of the legal cases by the Trump campaign focused on signature verification and other ballot irregularities. There are two main reasons why a signature would not match between a ballot and driver’s license or other records:
The signature may have been forged by someone trying to impersonate the voter.
The voter’s signature might not very consistent, or maybe they have more than one signature (for example, I sometimes sign in Hebrew and sometimes in English) .
Empirically, reason 2 is much more common than reason 1. If a ballot is tossed out because of the second reason it corresponds to a break between the voter intent and the final tally, and hence it is a case of election insecurity. For this reason, making more stringent signature checks could make elections less secure!
While President Trump might claim on Twitter that the election was stolen by a massive conspiracy involving forging of tens of thousands of ballots, this is not the actual content of the court cases (especially after some recentamendments). For example, at the heart of the PA case is the process of “curing a ballot“. This is when a ballot is disqualified due to some technical issue, and a voter has a chance to fix it. Curing a ballot ensures that the voters intent is captured, and hence makes elections more secure.
In PA, the decision of whether to notify voters in such cases was left to the counties, and apparently Democrat-controlled counties were more likely to do so Republican-controlled counties. This is a shame, and had the Trump campaign asked to extend the deadline for curing ballots, then I would think it makes perfect sense. However, this is not what their lawsuit is about. To quote their complaint: “plaintiffs seek a permanent injunction requiring the County Election Boards to invalidate ballots cast by voters who were notified and given an opportunity to cure their invalidly cast mail-in ballot.” This are ballots where there is no question of the eligibility of the voter, nor of the accuracy of their intent, yet the Trump campaign seeks to prevent them from counting. I call this election insecurity.
The 34th International Symposium on Distributed Computing (DISC 2020) was held on October 12-16, 2020, as a virtual conference. As such, the opportunity for community members to get to know each other in an informal environment was lacking. To address this need, we arranged two types of virtual networking events. We hope that these events planted the seeds for many future collaborations and that there will be an opportunity for those involved to meet in person next time.
To allow junior members of the community to get to know one another, we arranged MoPS sessions, which we have not seen done before. There were more than 50 participants who took part in the sessions, with representation from a host of countries throughout the world. Sessions were held in 10-time slots before, during, and after DISC. In each session, there would typically be 5 members representing a mixture of Bachelor’s students, Masters students, PhDs, postdocs, and others. Care was taken to include at least one postdoc or Ph.D. in each session so that Bachelors and Masters students might benefit from their experience. Groups were formed with the goal of allowing participants from different countries and institutions to share their experiences and research journeys with one another. Based on the feedback for this event, it would appear that that goal was met and the participants came away with more of a sense of community.
The Junior-Senior meetings were organized to provide an opportunity for junior researchers to meet with senior researchers. Fourteen sessions were conducted, where each one brought together one senior and 3-5 juniors. In these sessions, the juniors got a chance to interact with seniors in the field and profit from their experience. Discussions covered a variety of topics such as how to approach research, how to deal with the job market, or perhaps more personal concerns like work-life balance. We collected amazing feedback from the participants, who claimed that this was a fruitful and interesting experience.
I am teaching deep learing this week in Harvard’s CS 182 (Artificial Intelligence) course. As I’m preparing the back-propagation lecture, Preetum Nakkiran told me about Andrej Karpathy’s awesome micrograd package which implements automatic differentiation for scalar variables in very few lines of code.
I couldn’t resist using this to show how simple back-propagation and stochastic gradient descents are. To make sure we leave nothing “under the hood” we will not import anything from the package but rather only copy paste the few things we need. I hope that the text below is generally accessible to anyone familiar with partial derivatives. See this colab notebook for all the code in this tutorial. In particular, aside from libraries for plotting and copy pasting a few dozen lines from Karpathy this code uses absolutely no libraries (no numpy, no pytorch, etc..) and can train (slowly..) neural networks using stochastic gradient descent. (This notebook builds the code more incrementally.)
Automatic differentiation is a mechanism that allows you to write a Python functions such as
def f(x,y): return (x+y)+x**3
and enables one to automatically obtain the partial derivatives and . Numerically we could do this by choosing some small value and computing both and . However, if we generalize this approach to variables, we get an algorithm that requires roughly evaluations of . Back-propagation enables computing all of the partial derivatives at only constant overhead over the cost of a single evaluation of .
Back propagation and the chain rule
Back-propagation is a direct implication of the multi-variate chain rule. Let’s illustrate this for the case of two variables. Suppose that and are differentiable functions, and define
That is, we have the following situation:
where is the value
Then the chain rule states that
You can take this on faith, but it also has a simple proof. To see the intuition, note that for small , and . For small , . Hence, if we ignore terms with powers of delta two or higher,
Meaning that which is what we needed to show.
The chain rule generalizes naturally to the case that is a function of more variables than . Generally, if the value is obtained by first computing some intermediate values from and then computing in some arbitrary way from , then .
As a corollary, if you already managed to compute the values , and you kept track of the way that were obtained from , then you can compute .
This suggests a simple recursive algorithm by which you compute the derivative of the final value with respect to an intermediate value in the computation using recursive calls to compute the values for all the values that were directly computed from . Back propagation is this algorithm.
Implementing automatic differentiation using back propagation in Python
We now describe how to do this in Python, following Karpathy’s code. The basic class we use is Value. Every member of Value is a container that holds:
The actual scalar (i.e., floating point) value that holds. We call this data.
The gradient of with respect to some future unknown value that will use it. We call this grad and it is initialized to zero.
Pointers to all the values that were used in the computation of . We call this _prev
The method that adds (using the current value of and other values) the contribution of to the gradient of all its previous values to their gradients. We call this function _backward. Specifically, at the time we call _backward we assume that u.grad already contains where is the final value we are interested in. For every value that was used to compute , we add to v.grad the quantity . For the latter quantity we need to keep track of how was computed from .
If we call the method backwards (without an underscore) on a variable then this will compute the derivative of with respect to for all values that were used in the computation of . We do this by applying _backward to and then recursively (just like in DFS) going over the “children” (values used to compute ), calling _backward on each one and keeping track the ones we visited just like the Depth First Search (DFS) algorithm.
Let’s now describe this in code. We start off with a simple version that only supports addition and multiplication. The constructor for the class is the following:
""" stores a single scalar value and its gradient """
def __init__(self, data, _children=()):
self.data = data
self.grad = 0
self._backward = lambda: None
self._prev = set(_children)
which fairly directly matches the description above. This constructor creates a value not using prior ones, which is why the _backward function is empty. However, we can also create values by adding or multiplying prior ones, by adding the following methods:
def __add__(self, other):
other = other if isinstance(other, Value) else Value(other)
out = Value(self.data + other.data, (self, other))
self.grad += out.grad
other.grad += out.grad
out._backward = _backward
def __mul__(self, other):
other = other if isinstance(other, Value) else Value(other)
out = Value(self.data * other.data, (self, other))
self.grad += other.data * out.grad
other.grad += self.data * out.grad
out._backward = _backward
That is, if we create by adding the values and , then the _backward function of works by adding w.grad to both u.grad and v.grad. If we is obtain by multiplying and then we add w.gradv.data to u.grad and similarly add w.gradu.data to v.grad.
The backward function is obtained by setting the gradient of the current value to and then running _backwards on all other values in reverse topological order:
def backward(self, visited= None): # slightly shorter code to fit in the blog
if visited is None:
self.grad = 1
for child in self._prev:
if not child in visited:
then the values printed will be 0 and 89 since the derivative of equals .
In the notebook you can see that we implement also the power function, and have some “convenience methods” (division etc..).
Linear regression using back propagation and stochastic gradient descent
In stochastic gradient descent we are given some data and want to find an hypothesis that minimizes the empirical loss where is a loss function mapping two labels to a real number. If we let be the -th term of this sum, then, identifying with the parameters (i.e., real numbers) that specify it, stochastic gradient descent is the following algorithm:
Set to be a random vector. Set to be some small number (e.g., )
For (where is the number of epochs):
For : (in random order)
If is specified by the parameters is the vector . This is exactly the vector we can obtain using back propagation.
For example, if we want a linear model, we can use as our parameters and the function will be . We can generate random points X,Y as follows:
η = 0.03, epochs = 20
for t in range(epochs):
for x,y in zip(X,Y):
loss = (model(x)-y)**2
model.a , model.b = (model.a - η*model.a.grad , model.b - η*model.b.grad)
Which as you can see works very well:
From linear classifiers to Neural Networks.
The above was somewhat of an “overkill” for linear models, but the beautify of automatic differentiation is that we can easily use more complex computation.
We can follow Karpathy’s demo and us the same approach to train a neural network.
We will use a neural network that takes two inputs and has two hidden layers of width 16. A neuron that takes input will apply the ReLU function () to where are its weight parameters. (It’s easy to add support for relu for our Value class. Also we won’t have a bias term in this example.)
The code for this Neural Network is as follows: (when Value() is called without a parameter the value is random number in )
def Neuron(weights,inputs, relu =True):
# Evaluate neuron with given weights on given inputs
v = sum(weights[i]*x for i,x in enumerate(inputs))
return v.relu() if relu else v
# Depth 3 fully connected neural net with one two inputs and output
def __init__(self, N=16):
self.layer_1 = [[Value(),Value()] for i in range(N)]
self.layer_2 = [ [Value() for j in range(N)] for i in range(N)]
self.output = [ Value() for i in range(N)]
self.parameters = [v for L in [self.layer_1,self.layer_2,[self.output]] for w in L for v in w]
layer_1_vals = [Neuron(w,x) for w in self.layer_1]
layer_2_vals = [Neuron(w,layer_1_vals) for w in self.layer_2]
# the last output does not have the ReLU on top
for p in self.parameters:
We can train it in the same way as above. We will follow Karpathy and train it to classify the following points:
The training code is very similar, with the following differences:
Instead of the square loss, we use the function which is if . This makes sense since our data labels will be and we say we classify correctly if we get the same sign. We get zero loss if we classify correctly all samples with a margin of at least .
Instead of stochastic gradient descent we will do standard gradient descent, using all the datapoints before taking a gradient step. The optimal for neural networks is actually often something in the middle – batch gradient descent where we take a batch of samples and perform the gradient over them.
The resulting code is the following:
for t in range(epochs):
loss = sum([(1+ -y*model(x)).relu() for (x,y) in zip(X,Y)])/len(X)
for p in model.parameters:
p.data -= η*p.grad
If we use this, we get a decent approximation for this training set (see image below). As Karpathy shows, by adjusting the learning rate and using regularization, one can in fact get 100% accuracy.
Update 11/30: Thanks to Gollamudi Tarakaram for pointing out a typo in a previous version.
With election on my mind, and constantly looking at polls and predictions, I thought I would look a little more into how election models are made. (Disclaimer: I am not an expert statistician / pollster and this is based on me trying to read their methodological description as well as looking into results of simulations in Python. However, there is a colab notebook so you can try this on your own!)
If polls were 100% accurate, then we would not need election models – we will know that the person polling at more than 50% in a given state will win, and we can just sum up the electoral votes. However, polls have various sources of errors:
Statistical sample error – this is simply the deviation between the fraction of people that would say “I will vote for X” at time T in the population, and the empirical fraction reported by the poll based on their sample. As battleground states get polled frequently with large samples, this error is likely to be negligible.
Sampling bias – this is the bias incurred by the fact that we cannot actually sample a random subset of the population and get them to answer our questions – the probability that people will pick up their phone may be correlated with their vote. Pollsters hope that these correlations all disappear once you condition on certain demographic variables (race, education, etc..) and so try to ensure the sample is balanced according to these metrics. I believe this was part of the reason that polls were off in 2016, since they didn’t explicitly adjust for levels of education (which were not strongly correlated with party before) and ended up under-representing white voters without college degrees.
Lying responses or “shy” voters – Some people suggest that voters lie to pollsters because their choice is considered “socially undesirable”. There is not much support that this is a statistically significant effect. In particular one study showed there was no statistically significant difference between responders’ responses in online and live calling. Also in 2016 polls equally under-estimated the votes for Trump and Republican senators (which presumably didn’t have the same “social stigma” to them).
Turnout estimates – Estimating the probability that a person supporting candidate X will actually show up to vote (or mail it in) is a bit of a dark art, and account for the gap in polls representing registered voters (which make no such estimates) and polls representing likely voters (which do). Since traditionally the Republican electorate is older and more well off, they tend to vote more reliably and hence likely voter estimates are typically better for republicans. The effect seems not to be very strong this year. Turnout might be particularly hard to predict this year, though it seems likely to be historically high.
Voters changing their mind – The poll is done at a given point in time and does not necessarily reflect voters views in election day. For example in 2016 it seems that many undecided voters broke for Trump. In this cycle the effect might be less pronounced since there are few undecided voters and “election day” is smoothed over a 2-4 week period due to early and mail-in voting.
To a first approximation, a poll-based election model does the following:
1. Aggregates polls into national and state-wise predictions
2. Computes a probability distribution over the correlated error vectors (i.e. the vector with coordinate for each jurisdiction containing the deviation from the prediction)
3. Samples from the probability distribution over vectors to obtain probabilities over outcomes.
Aggregate polls (weighing by quality, timeliness, adjusting for house effects, etc..). Earlier in the election cycle they also mix in “fundamentals” such as state of the economy etc.. though their weight decreases with time.
Estimate magnitude of national error (i.e., sample a value according to some distribution that reflects the amount of national uncertainty.
(This is where I may be understanding wrong.) Sample a vector whose entries sum up to according to a correlated distribution, where the correlations between states depends on demographic, location, and other factors. For each particular choice of $E$, because the sum is fixed, if a state has $E+X$ bias then on average the other states will need to compensate for this $-X$ bias, and hence this can create negative correlations between states. (It is not clear that negative correlations are unreasonable – one could imagine policies that are deeply popular with population A and deeply unpopular with population B)
They start again with some estimate on the national popular vote, based on polls and fundamentals, and then assume it is distributed according to some probability distribution to account for errors.
They then compute some prior on “partisan lean” (difference between state and national popular vote) for each state. If we knew the popular vote and partisan lean perfectly then we would know the result. Again like good Bayesians they assume that the lean is distributed according to some probability distribution.
They update the prior based on state polls and other information
They sample from an error distribution according to some explicit pairwise correlation matrix that has only non-negative entries (and hence you don’t get negative correlations in their model).
So, given all of the above, how much do these models differ? Perhaps surprisingy, the answer is “not by much”. To understand how they differ, I plotted for both models the following:
The histogram of Biden’s popular vote margin
The probability of Biden to win conditioned on a particular margin
Much of the methodological difference, including the issue of pairwise correlations, should manifest in 2, but eyeballing it, they don’t seem to differ that much. It seems that conditioned on a particular margin, both models give Biden similar probability to win. (In particular both models think that 3% margin is about 50/50, while 4% margin gives Biden about 80/20 chance). The main difference is actually in the first part of estimating the popular vote margin – 538 is more “conservative” and has fatter tails.
If you want to check my data, see if I have a bug, or try your own analysis, you can use this colab notebook.
“Make your own needle”
Another applications for such models is to help us adjust the priors as new information comes in. For example, it’s possible that Florida, North Carolina and Texas will report results early. If Biden loses one of these states, should we adjust our estimate of win probability significantly? It turns out that the answer depends on by how much he loses.
The following graphs show the updated win probability conditioned on a particular margin in a state. We see that winning or losing Florida, North Carolina, and Texas on their own doesn’t make much difference to the probability – it’s all about the margin. In contrast, losing Pennsylvania’s 20 electoral votes will make a significant difference to Biden’s chances.
(The non monotonicity is simply a side effect of having a finite number of simulation runs and would disappear in the limit.)
In May 2016, after Donald Trump was elected as the republican nominee for president, I wrote the following blog post. I ended up not publishing it – this has always been a technical blog (and also more of a group blog, at the time). While the damage of a Donald Trump presidency was hypothetical at the time, it is now very real and in a second term the stakes are only higher. I once again hope American readers of this blog would do what they can to support Joe Biden.
Note: this is not an invitation for a debate on who to vote for in the comments. At this point, if you are educated and following the news (as I imagine all readers of this blog are) then if you are not already convinced that Donald Trump is a danger to this country and the world, nothing I will say will change your mind. Similarly, nothing you will say will change mine. Hence this is just a call for those readers who already support Joe Biden to make sure they vote and think of how they can help with their money or time in other ways.
I’m with Her
Boaz Barak / May 3, 2016
The republican electorate, in their infinite wisdom, have just (essentially) finalized the election of Donald Trump as their nominee for the position of the president of the United States.
While I have my political views, I don’t consider myself a very political person, and have not (as far as I remember) ever written about politics in this blog. However, extreme times call for extreme measures. It is tempting to be fatalist or cynical about this process, and believe that whether Donald Trump or Hillary Clinton is elected doesn’t make much of a difference. Some people believe that the presidency shapes the person more than the other way around, and others feel that all politicians are anyway corrupt or that Hillary is not much better than trump since she voted for the Iraq war and gave paid speeches for Wall Street firms. I think the last two presidencies of George W. Bush and Barack Obama demonstrated that the identity of the president makes a huge difference. All evidence points out that with Trump this difference will be entirely in the negative direction.
While his chances might not be great, this is not a bet I’m comfortable taking. I plan to support Hillary Clinton as much as I can, and hope that other American readers of this blog will do the same
One of the fascinating lines of research in recent years has been a convergence between the statistical physics and theoretical computer science points of view on optimization problems. ` This blog post is mainly a note to myself (i.e., I’m the “dummy” 😃), trying to work out some basic facts in some of this line of work. it was inspired by this excellent talk of Eliran Subag, itself part of a great Simons institute workshop which I am still planning to watch the talks of. I am posting this in case it’s useful for others, but this is quite rough, missing many references, and I imagine I have both math mistakes as well as inaccuracies in how I refer to the literature – would be grateful for comments!
In computer science, optimization is the task of finding an assignment that minimizes some function . In statistical physics we think of as the states of particles, and as the energy of this state. Finding the minimum assignment corresponds to finding the ground state, and another computational problem is sampling from the Gibbs distribution where the probability of is proportional to for some .
Two prototypical examples of such problems are:
Random 3SAT – in this case and is the number of clauses violated by the assignment for a random formula.
Sherrington-Kirpatrick model – in this case and where are independent normal variables with variance for and variance for . (Another way to say it is that is the matrix where ‘s entries are chosen i.i.d from .)
The physics and CS intuition is that these two problems have very different computational properties. For random 3SAT (of the appropriate density), it is believed that the set of solutions is “shattered” in the sense that it is partitioned to exponentially many clusters, separated from one another by large distance. It is conjectured that in this setting the problem will be computationally hard. Similarly from the statistical physics point of view, it is conjectured that if we were to start with the uniform distribution (i.e., a “hot” system) and “lower the temperature” (increase ) at a rate that is not exponentially slow then we will get “stuck” at a “metastable” state. This is analogous how when we heat up sand and then cool it quickly then rather than returning to its original state, the sand will get stuck at the metastable state of glass.
In contrast for the Sherrington-Kirpatrick (SK) model, the geometry is more subtle, but interestingly this enables better algorithms. The SK model is extermely widely studied, with hundreds of papers, and was the inspiration for the simulated annealing algorithm. If memory serves me right, Sherrington and Kirpatrick made the wrong conjecture on the energy of the ground state, and then Parisi came up in 1979 with a wonderful and hugely influential way to compute this value. Parisi’s calculation was heuristic, but about 30 years later, first Talagrand and later Panchenko proved rigorously many of Parisi’s conjectures. (See this survey of Panchenko.)
Recently Montanari gave a polynomial time algorithm to find a state with energy that is arbitrarily close to the ground state’s. The algorithm relies on Parisi’s framework and in particular on the fact that the solution space has a property known as “full replica symmetry breaking (RSB)” / “ultrametricity”. Parisi’s derivations (and hence also Montanari’s analysis) are highly elaborate and I admit that I have not yet been able to fully follow it. The nice thing is that (as we’ll see) it is possible to describe at least some of the algorithmic results without going into this theory. In the end of the post I will discuss a bit some of the relation to this theory, which is the underlying inspiration for Subag’s results described here.
Note: These papers and this blog post deal with the search problem of finding a solution that minimizes the objective. The refutation problem of certifying that this minimum is at least for some has often been studied. The computational complexity of these problems need not be identical. In particular there are cases where the search problem has an efficient algorithm achieving value but the best refutation algorithm can only certify that the value is at most for .
Analysis of a simpler setting
Luckily, there is a similar computational problem, for which the analysis of analogous algorithm, which was discovered by Subag and was the partial inspiration for Montanari’s work, is much simpler. Specifically, we consider the case where is an element of the unit sphere, and is a degree polynomial with random Gaussian coefficients. Specifically, for every vector , we let where for every , is a random tensor of order whose coefficients are all chosen i.i.d in . (We assume that polynomial does not have constant or linear components.)
Depending on , the computational and geometrical properties of this problem can vary considerably. The case that (i.e., only has a non-zero coeffiecent) corresponds to finding the unit vector minimizing for a random matrix , which of course corresponds to the efficiently solveable minimum eigenvector problem. In contrast, the case corresponds to finding a rank one component of a random three-tensor, which is believed to be computationally difficult. The Parisi calculations give a precise condition on the vector such that if holds then the solution space has the “full RSB” property (and hence the problem is computationally easy) and if does not hold then the solution space does not have this property (and potentially the problem is hard).
These calculations also give rise to the following theorem:
Theorem (Chen and Sen, Proposition 2): If holds then in the limit , , where . (That is, is the second derivative of this univariate polynomial)
We will not discuss the proof of this theorem, but rather how, taking it as a black box, it leads to an algorithm for minimizing that achieves a near-optimal value (assuming holds).
It is a nice exercise to show that for every two vectors , . Hence for any unit vector , is a random variable with mean zero and standard deviation . Since (after some coarsening) the number of unit vectors of dimension can be thought of as for some , and we expect the probability of deviating standard deviations to be , the minimum value of should be for some constant . However determining this constant is non trivial and is the result of the Parisi theory.
To get a better sense for the quantity , let’s consider two simple cases:
If (i.e., for random matrix ) then and , meaning that . This turns out to be the actual minimum value. Indeed in this case . But the matrix ‘s non diagonal entries are distributed like and the diagonal entries like which means that is distributed as times a random matrix from the Gaussian Orthogonal Ensemble (GOE) where for off diagonal entries and for diagonal entries. The minimum eigenvalue of such matrices is known to be with high probability.
If (i.e. for a random -tensor ) then does not hold. Indeed, in this case the value for large . However I believe (though didn’t find the reference) that the actual minimum tends to with .
While the particular form of the property is not important for this post, there are several equivalent ways to state it, see Proposition 1 in Subag’s paper. One of them is that the function (note the negative exponent) is concave on the interval . It can be shown that this condition cannot be satisfied if , and that for every setting of , if is large enough then it will be satisfied.
The central result of Subag’s paper is the following:
Theorem: For every , there is a polynomial-time algorithm such that on input random chosen according to the distribution above, with high probability such that .
The algorithm itself, and the idea behind the analysis are quite simple. In some sense it’s the second algorithm you would think of (or at least the second algorithm according to some ordering).
The first algorithm one would think of is gradient descent. We start at some initial point , and repeat the transformation for some small (and normalizing the norm). Unfortunately, we will generally run into saddle points when we do so, with the gradient being zero. In fact, for simplicity, below we will always make the pessimistic assumption that we are constantly on a saddle point. (This assumption turns out to be true in the actual algorithm, and if it was not then we can always use gradient descent until we hit a saddle.)
The second algorithm one could think of would be to use the Hessian instead of the gradient. That is, repeat the transformation where is the minimal eigenvector of (i.e., the Hessian matrix such that ). By the Taylor approximation (and since we assume the gradient is zero) the change in the objective will be roughly . (Because we assume the gradient vanishes, it will not make a difference whether we update with or , but we use for consistency with gradient descent.)
The above approach is promising, but we still need some control over the norm. The way that Subag handles this is that he starts with , and at each step takes a step in an orthogonal direction, and so within steps he will get to a unit norm vector. That is, the algorithm is as follows:
Goal: Find unit approximately minimizing
For : i. Let be a unit vector such that is orthogonal to and . (Since the bottom eigenspace of has large dimention, we can find a vector that is not only nearly minimal eigenvector but also orthogonal to all prior ones. Also, as mentioned, we assume that .) ii. Set .
(The fact that the number of steps is and not is absolutely crucial for the algorithm’s success; without it we would not have been able to use the second order contribution that arise from the Hessian.)
If we define to be the minimum eigenvalue at time , we get that the final objective value achieved by the algorithm satisfies
Now due to rotation invariance, the distribution of at the point is the same as at the point . Using concentration of measure arguments, it can be shown that the minimum eigenvalue of will be close with high probability to the minimum eigenvalue of . Since we can write
where is the minimum eigenvalue of at the point . Taking to zero, we get that (approximately) the value of the solution output by the algorithm will satisfy
and hence the result will be completed by showing that
To do this, let’s recall the definition of :
where for every , is a random tensor of order whose coefficients are all chosen i.i.d in .
For simplicity, let’s assume that and hence
(The calculations in the general case are similar)
The entry of equals . The contribution of the component to this term only arises from the terms corresponding to either or and hence for it equals which is distributed like . For , since , the contributioon equals which is distributed like .
The contribution from the component comes (in the case ) from all the terms involving that is, which is distributed like . For the contribution will be from the terms involving , with each yielding a contribution of , and hence the result will be distributed like .
(More generally, for larger , the number of terms for distinct is , each contributing a Gaussian of standard deviation , while for we have terms, each contributing a Gaussian of standard deviation .)
Since the sum of Gaussians is a Gaussian we get that is distributed like a Gaussian with variance for , and twice that for . This means that the minimum eigenvalue of equals times the minimum eigenvalue of a random matrix from the Gaussian Orthogonal Ensemble (i.e. is sampled via , ). As mentioned above, it is known that this minimum eigenvalue is , and in fact by the semi-circle law, for every , the number of eigenvalues of value is , and so we can also pick one that is orthogonal to the previous directions. QED
Full replica symmetry breaking and ultra-metricity
The point of this blog post is that at least in the “mixed spin” case considered by Subag, we can understand what the algorithm does and the value that it achieves without needing to go into the theory of the geometry of the solution space, but let me briefly discuss some of this theory. (As I mentioned, I am still reading through this, and so this part should be read with big grains of salt.)
The key object studied in this line of work is the probability distribution of the dot product for and sampled independently from the Gibbs distribution induced by . (This probability distribution will depend on the number of dimensions , but we consider the case that .)
Intuitively, there are several ways this probability distribution can behave, depending on how the solution space is “clustered”:
If all solutions are inside a single “cluster”, in the sense that they are all of the form where is the “center” of the cluster and is some random vector, then will be concentrated on the point .
If the solutions are inside a finite number of clusters, with centers , then the support of the distribution will be on the points .
Suppose that the solutions are inside a hierarchy of clusters. That is, suppose we have some rooted tree (e.g., think of a depth full binary tree), and we associate a vector with every vertex of , with the property that is orthogonal to all vectors associated with ‘s ancestors on the tree. Now imagine that the distribution is obtained by taking a random leaf of and outputting for all vertices on the path from the root to . In such a case the dot product of and will be taken over all the common ancestors of . As the dimension and depth of the tree goes to infinity, the distribution over dot product can have continuous support, and it is this setting (specifically when the support is an interval ) that is known as full replica symmetry breaking. Because the dot product is determined by common ancestor, for every three vectors in the support of the distribution or . It is this condition that known as ultra-metricity.
In Subag’s algorithm, as mentioned above, at any given step we could make an update of either or . If we think of all the possible choices for the signs in the of the algorithms, we see that the algorithm does not only produce a single vector but actually such vectors that are arranged in an ultrametric tree just as above. Indeed, this ultrametric structure was the inspiration for the algorithm and is the reason why the algorithm produces the correct result precisely in the full replica symmetry breaking regime.
Acknowledgements: Thanks to Tselil Schramm for helpful comments.