Google Docs: A New Hope

I suspect the Google Docs grammar bot is the least useful bot there is. After hundreds of suggestions, I can think of only one instance in which it was right. Is its failure rate so high because it learns from how other people use English, instead of drawing from a basic ruleset?

I’m not saying my grammar is better than everyone else’s but if the bot is learning from how non-native users of the English language construct their sentences, I can see how it would make the suggestions it does, especially about the use of commas and singular/plural referents.

Then again, what I see as failure might be entirely invisible to someone not familiar with, or even interested in, punctuation pedantry. This is where Google Docs’s bot presents an interesting opportunity.

The rules of grammar and punctuation exist to assist the construction and inference of meaning, not to railroad them. However, this definition doesn’t say whether good grammar is simply what most people use and are familiar with or what is derived from a foundational set of rules and guidelines.

Thanks to colonialism, imperialism and industrialism, English has become the world’s official language, but thanks to their inherent political structures, English is also the language of the elite in postcolonial societies that exhibit significant economic inequality.

So those who wield English ‘properly’ – by deploying the rules of grammar and punctuation the way they’re ‘supposed’ to – are also those who have been able to afford a good education. Ergo, deferring to the fundamental ruleset is to flaunt one’s class privilege, and to expect others to do so could play out as a form of linguistic subjugation (think The New Yorker).

On the other hand, the problem with the populist ontology is that it encourages everyone to develop their own styles and patterns based on what they’ve read – after all, there is no one corpus of popular literature – that are very weakly guided by the same logic, if they’re guided by any logic at all. This could render individual pieces difficult to read (or edit).

Now, a question automatically arises: So what? What does each piece employing a different grammar and punctuation style matter as long as you understand what the author is saying? The answer, to me at least, depends on how the piece is going to find itself in the public domain and who is going to read it.

For example, I don’t think anyone would notice if I published such erratic pieces on my blog (although I don’t) – but people will if such pieces show up in a newspaper or a magazine, because newsrooms enforce certain grammatical styles for consistency. Such consistency ensures that:

  1. Insofar as grammar must assist inference, consistent patterns ensure a regular reader is familiar with the purpose the publication’s styleguide serves in the construction of sentences and paragraphs, which in turn renders the symbols more useful and invisible at the same time;
  2. The writers, while bringing to bear their own writing styles and voices, still use a ‘minimum common’ style unique to and associated with the publication (and which could ease decision-making for some writers); and
  3. The publication can reduce the amount of resources expended to train each new member of its copy-editing team

Indeed, I imagine grammatical consistency matters to any professional publication because of the implicit superiority of perfect evenness. But where it gets over the top and unbearable is when its purpose is forgotten, or when it is effected as a display of awareness of, or affiliation to, some elite colonial practice.

Now, while we can agree that the populist definition is less problematic on average, we must also be able to recognise that the use of a ‘minimum common’ remains a good idea if only to protect against the complete dilution of grammatical rules with time. For example, despite the frequency with which it is abused, the comma still serves at least one specific purpose: to demarcate clauses.

In this regard, the Google Docs bot could help streamline the chaos. According to the service’s support documentation, the bot learns its spelling instead of banking exclusively on a dictionary; it’s not hard to extrapolate this behaviour to grammar and syntactic rules as well.

Further, every time you reject the bot’s suggested change, the doc displays the following message: “Thanks for submitting feedback! The suggestion has been automatically ignored.” This isn’t sufficient evidence to conclude that the bot doesn’t learn. For one, the doc doesn’t display a similar message when a suggestion is accepted. For another, Google tracks the following parameters when you’re editing a doc:

customer-type, customer-id, customer-name, storageProvider, isOwner, editable, commentable, isAnonymousUser, offlineOptedIn, serviceWorkerControlled, zoomFactor, wasZoomed, docLocale, locale, docsErrorFatal, isIntegrated, companion-guest-Keep-status, companion-guest-Keep-buildLabel, companion-guest-Tasks-status, companion-guest-Tasks-buildLabel, companion-guest-Calendar-status, companion-guest-Calendar-buildLabel, companion-expanded, companion-overlaying-host-content, spellGrammar, spellGrammarDetails, spellGrammarGroup, spellGrammarFingerprint

Of them, spellGrammar is set to true and I assume spellGrammarFingerprint corresponds to a unique ID.

So assuming further that it learns through individual feedback, the bot must be assimilating a dataset in the background within whose rows and columns an ‘average modal pattern’ could be taking shape. As more and more users accept or reject its suggestions, the mode could become correspondingly more significant and form more of the basis for the bot’s future suggestions.

There are three problems, however.

First, if individual preferences have diverged to such an extent as to disfavour the formation of a single most significant modal style, the bot is unlikely to become useful in a reasonable amount of time or unless it combines user feedback with the preexisting rules of grammar and composition.

Second, Google could have designed each bot to personalise its suggestions according to each account-holder’s writing behaviour. This is quite possible because the more the bot is perceived to be helpful, the likelier its suggestions are to be accepted, and the likelier the user is to continue using Google Docs to compose their pieces.

However, I doubt the bot I encounter on my account is learning from my feedback alone, and it gives me… hope?

Third: if the bot learns only spelling but not grammar and punctuation use, it would be – as I first suspected – the least useful bot there is.

Making sense of quantum annealing

One of the tougher things about writing and reading about quantum mechanics is keeping up with how the meaning of some words change as they graduate from being used in the realm of classical mechanics – where things are what they look like – to that of the quantum – where we have no idea what the things even are. If we don’t keep up but remain fixated on what a word means in one specific context, then we’re likely to experience a cognitive drag that limits our ability to relearn, and reacquire, some knowledge.

For example, teleportation in the classical sense is the complete disintegration of an individual or object in one location in space and its reappearance in another almost instanetaneously. In quantum mechanics, teleportation is almost always used to mean the simultaneous realisation of information at two points in space, not necessarily their transportation.

Another way to look at this: to a so-called classicist, teleportation means to take object A, subject it to process B and so achieve C. But when a quantumist enters the picture, claiming to take object A, subjecting it to a different process B* and so achieving C – and still calling it teleportation, we’re forced to jettison the involvement of process B or B* from our definition of teleportation. Effectively, teleportation to us goes from being A –> B –> C to being just A –> C.

Alfonso de la Fuente Ruiz, an engineering student at the Universidad de Burgos, Spain, in 2011, wrote in an article,

In some way, all methods for annealing, alloying, tempering or crystallisation are metaphors of nature that try to imitate the way in which the molecules of a metal order themselves when magnetisation occurs, or of a crystal during the phase transition that happens for instance when water freezes or silicon dioxide crystallises after having been previously heated up enough to break its chemical bonds.

So put another way, going from A –> B –> C to A –> C would be us re-understanding a metaphor of nature, and maybe even nature itself.

The thing called annealing has a similar curse upon it. In metallurgy, annealing is the process by which a metal is forced to recrystallise by heating it above its recrystallisation temperature and then letting it cool down. This way, the metal’s internal stresses are removed and the material becomes the stronger for it. Quantum annealing, however, is referred by Wikipedia as a “metaheuristic”. A heuristic is any technique that lets people learn something by themselves. A metaheuristic then is any technique that produces a heuristic. It is commonly found in the context of computing. What could it have to do with the quantum nature of matter?

To understand whatever is happening first requires us to acknowledge that a lot of what happens in quantum mechanics is simply mathematics. This isn’t always because physicists are dealing with unphysical entities; sometimes it’s because they’re dealing with objects that exist in ways that we can’t even comprehend (such as in extra dimensions) outside the language of mathematics.

So, quantum annealing is a metaheuristic technique that helps physicists, for example, look for one specific kind of solution to a problem that has multiple independent variables and a very large number of ways in which they can influence the state of the system. This is a very broad definition. A specific instance where it could be used is to find the ground state of a system of multiple particles. Each particle’s ground state comes to be when that particle has the lowest energy it can have and still exist. When it is supplied a little more energy, such as by heating, it starts to vibrate and move around. When it is cooled, it loses the extra energy and returns to its ground state.

But in a larger system consisting of more than a few particles, a sense of the system’s ground state doesn’t arise simply by knowing what each particle’s ground state is. It also requires analysing how the particles’ interactions with each other modifies their individual and cumulative energies. These calculations are performed using matrices with 2N rows if there are particles. It’s easy to see that the calculations can become quickly mind-boggling: if there are 10 particles, then the matrix is a giant grid with 1,048,576 cells. To avoid this, physicists take recourse through quantum annealing.

In the classical metallurgical definition of annealing, a crystal (object A) is heated beyond its recrystallisation temperature (process B) and then cooled (outcome C). Another way to understand this is by saying that for A to transform into C, it must undergo B, and then that B would have to be a process of heating. However, in the quantum realm, there can be more than one way for A to transform into C. A visualisation of the metallurgical annealing process shows how:

The x-axis marks time, the y-axis marks heat, or energy. The journey of the system from A to C means that, as it moves through time, its energy rises and then falls in a certain way. This is because of the system’s constitution as well as the techniques we’re using to manipulate it. However, say the system included a set of other particles (that don’t change its constitution), and that for those particles to go from A to C didn’t require conventional energising but a different kind of process (B) and that B is easier to compute when we’re trying to find C.

These processes actually exist in the quantum realm. One of them is called quantum tunneling. When the system – or let’s say a particle in the system – is going downhill from the peak of the energy mountain (in the graph), sometimes it gets stuck in a valley on the way, akin to the system being mostly in its ground state except in one patch, where a particle or some particles have knotted themselves up in a configuration such that they don’t have the lowest energy possible. This happens when the particle finds an energy level on the way down where it goes, “I’m quite comfortable here. If I’m to keep going down, I will need an energy-kick.” Such states are also called metastable states.

In a classical system, the particle will have to be given some extra energy to move up the energy barrier, and then roll on down to its global ground state. In a quantum system, the particle might be able to tunnel through the energy barrier and emerge on the other side. This is thanks to Heisenberg’s uncertainty principle, which states that a particle’s position and momentum (or velocity) can’t both be known simultaneously with the same accuracy. One consequence of this is that, if we know the particle’s velocity with great certainty, then we can only suspect that the particle will pop up in a given point in spacetime with fractional surety. E.g., “I’m 50% sure that the particle will be in the metastable part of the energy mountain.”

What this also means is that there is a very small, but non-zero, chance that the particle will pop up on the other side of the mountain after having borrowed some energy from its surroundings to tunnel through the barrier.

In most cases, quantum tunneling is understood to be a problem of statistical mechanics. What this means is that it’s not understood at a per-particle level but at the population level. If there are 10 million particles stuck in the metastable valley, and if there is a 1% chance for each particle to tunnel through the valley and come out the other side, then we might be able to say 1% of the 10 million particles will tunnel; the remaining 90% will be reflected back. There is also a strange energy conservation mechanism at work: the tunnelers will borrow energy from their surroundings and go through while the ones bouncing back will do so at a higher energy than they had when they came in.

This means that in a computer that is solving problems by transforming A to C in the quickest way possible, using quantum annealing to make that journey will be orders of magnitude more effective than using metallurgical annealing because more particles will be delivered to their ground state, fewer will be left behind in metastable valleys. The annealing itself is a metaphor: if a piece of metal recalibrates itself during annealing, then a problematic quantum system resolves itself through quantum annealing.

To be a little more technical: quantum annealing is a set of algorithms that introduces new variables into the system (A) so that, with their help, the algorithms can find a shortcut for A to turn into C.

The world’s most famous quantum annealer is the D-Wave system. Ars Technica wrote this about their 2000Q model in January 2017:

Annealing involves a series of magnets that are arranged on a grid. The magnetic field of each magnet influences all the other magnets—together, they flip orientation to arrange themselves to minimize the amount of energy stored in the overall magnetic field. You can use the orientation of the magnets to solve problems by controlling how strongly the magnetic field from each magnet affects all the other magnets.

To obtain a solution, you start with lots of energy so the magnets can flip back and forth easily. As you slowly cool, the flipping magnets settle as the overall field reaches lower and lower energetic states, until you freeze the magnets into the lowest energy state. After that, you read the orientation of each magnet, and that is the solution to the problem. You may not believe me, but this works really well—so well that it’s modeled using ordinary computers (where it is called simulated annealing) to solve a wide variety of problems.

As the excerpt makes clear, an annealer can be used as a computer if system A is chosen such that it can evolve into different Cs. The more kinds of C there are possible, the more problems that A can be used to solve. For example, D-Wave can find better solutions than classical computers can for problems in aerodynamic modelling using quantum annealing – but it still can’t crack Shor’s algorithm, used widely in data encryption technologies. So the scientists and engineers working on D-Wave will be trying to augment their A such that Shor’s algorithm is also within reach.

Moreover, because of how 2000Q works, the same solution can be the result of different magnetic configurations – perhaps even millions of them. So apart from zeroing in on a solution, the computer must also figure out the different ways in which the solution can be achieved. But because there are so many possibilities, D-Wave must be ‘taught’ to identify some of them, all of them or a sample of them in an unbiased manner.

Thus, such are the problems that people working on the edge of quantum computing have to deal with these days.

(To be clear: the ‘A’ in the 2000Q is not a system of simple particles as much as it is an array of qubits, which I’ll save for a different post.)

Featured image credit: Engin_Akyurt/pixabay.

The unclosed clause and other things about commas

The Baffler carried a fantastic critique of The New Yorker‘s use of commas by Kyle Paoletta on August 23. Excerpt:

The magazine’s paper subscription slips have long carried a tagline: “The best writing, anywhere.” It follows that the source of the best writing, anywhere, must also be the finest available authority on grammar, usage, and punctuation. But regular readers know that The New Yorker’s signature is not standard usage, but its opposite. Nowhere else will you find an accent aigu on “élite” or a diaeresis on “reëmerge.” And the commas—goodness, the commas! These peculiarities are as intrinsic to the magazine’s brand as the foppish Eustace Tilley, and, in the digital age, brand determines content. But the rise of the magazine’s copy desk has done more for The New Yorker than simply generate clicks. It has bolstered the reputation of the magazine as a peerless institution, a class above the Vanity Fairs and Economists of the world, even if the reporting and prose in those publications is on par with (if not often better than) what fills the pages of The New Yorker.

Paoletta’s piece was all the more enjoyable because it touched on all the little notes about commas that most people usually miss. In one example, he discusses the purpose of commas, split as they are between subordination and rhythm. The former is called so because it “subordinates” content to the grammatical superstructure applied to it. Case in point: a pair of commas is used to demarcate a dependent clause – whether or not it affects the rhythm of the sentence. On the other hand, the rhythmic purpose denotes the use of commas and periods for “varying amounts of breath”. Of course, Paoletta doesn’t take kindly to the subordination position.

Not only does this attitude treat the reader as somewhat dim, it allows the copy editor to establish a position of privilege over the writer. Later in the same excerpt, [Mary] Norris frets over whether or not some of James Salter’s signature descriptive formulations (a “stunning, wide smile,” a “thin, burgundy dress”) rely on misused commas. When she solicits an explanation, he answers, “I sometimes ignore the rules about commas… Punctuation is for clarity and also emphasis, but I also feel that, if the writing warrants it, punctuation can contribute to the music and rhythm of the sentences.” Norris begrudgingly accepts this defense, but apparently only because a writer of no lesser stature than Salter is making it.

I’m firmly on the subordination side of things: more than indicating pause, commas are scaffolding for grammar, and thus essential to conveying various gradations of meaning. Using a comma to enforce a pause, or invoke an emphasis, is also meaningless because pauses must originate not out of the writer’s sense of anticipation and surprise but out of the clever arrangement of words and sentences, out of the use of commas to suppress some senses and enhance others. It is not the explicit purpose of written communication to also dictate how it should be performed.

Along the same vein, I’m aware that using the diaeresis in words like ‘reemerge’ is also a form of control expressed over the performance of language, and one capable of assuming political overtones in some contexts. For example, English is India’s official language, the one used for all official documentation and almost all purposes of identification. However, English is also the tongue of colonialists. As a result, its speakers in India are those who (a) have been able to afford education in a good school, (b) have enjoyed a social standing that, in the pre-Independence period, brought them favours from the British, (c) by virtue of pronouncing some words this way or that, have had access to British or American societies, or combinations of some or all of them. So beating upon the reader that this precisely is how a word ought to be pronounced could easily be The New Yorker using a colonial cudgel over the heads of “no speak English” ‘natives’.

That said, debating the purpose of commas from the PoV of The New Yorker is one thing. Holding the same debate from the PoV of most English-language newspapers and magazines in the Indian mainstream media is quite another. The comma, in this sphere, is given to establishing rhythm for an overwhelming majority of writers and copy-editors, even though what we’re taught in school is only the use of commas for – as Paoletta put it – subordination. A common mistake that arises out of this position is that, more often than you’d like, clauses are not closed. Here’s an example from The Wire:

Gertrud Scholtz-Klink, described by Hitler as the “perfect Nazi woman” was held in check by male colleagues when she proposed that female members be awarded similar titles to the males.

There ought to be a comma after woman” and before was but there isn’t. This comma would be the terminal counterpart to the one that flagged off the start of the dependent clause (described by Hitler as…). Without it, what we have are two dependent clauses demarcated by one comma and no independent clauses – which there ought to be considering we’re looking at what happens to be a full and complete sentence.

The second most common type of comma-related mistake goes something like the following sentence (picked up from the terms of service of Authory.com):

You are responsible for the content, that you make available via Authory.

What the fuck is that comma even doing there? Does the author really think we ought to pause between “content” and “that”? While Salter it would seem used the comma to construct a healthy sense of rhythm, Authory – and hundreds of writers around the world – mortgage punctuation to build the syntactic versions of dubstep. This issue also highlights the danger in letting commas denote rhythm alone: rhythm is subjective, and ordering the words in sentences using subjective rules cannot ever make for a consistent reading experience. On the other hand, using commas as a matter of an objective ruleset would help achieve what Paoletta writes is overarching purpose of style:

[Style], unlike usage, has no widely agreed upon correct answers. It is useful only insofar as it enforces consistency. Style makes unimportant decisions so that writers don’t have to—about whether to spell the element “sulfur” or “sulphur,” or if it’s best to italicize the names of films or put them in quotes. It is not meant to be noticed: it is meant to remove the possibility of an inconsistency distracting the reader from experiencing the text as the writer intends.


Here again, of course, I’m not about to let many Indian copy-editors and writers off the hook. Paoletta cites Norris’s defence of the following paragraph as an example of style enforcement gone overboard:

Strait prefers to give his audience as few distractions as possible: he likes to play on a stage in the center of the arena floor, with four microphones arranged like compass points; every two songs, he moves, counterclockwise, to the next microphone, so that people in each quadrant of the crowd can feel as if he were singing just to them.

Compare this aberration to nothing short of the outright misshapenness that was an oped penned by Gopalkrishna Gandhi for The Hindu in May 2014. Excerpt:

In invoking unity and stability, you have regularly turned to the name and stature of Sardar Vallabhbhai Patel. The Sardar, as you would know, chaired the Constituent Assembly’s Committee on Minorities. If the Constitution of India gives crucial guarantees — educational, cultural and religious — to India’s minorities, Sardar Patel has to be thanked, as do other members of that committee, in particular Rajkumari Amrit Kaur, the Christian daughter of Sikh Kapurthala. Adopt, in toto, Mr. Modi, not adapt or modify, dilute or tinker with, the vision of the Constitution on the minorities. You may like to read what the indomitable Sardar said in that committee. Why is there, in so many, so much fear, that they dare not voice their fears?

A criticism of the oped along these lines that appeared on the pages of this blog elicited a cocky, but well-meaning, repartee from Gandhi:

Absolutely delighted and want to tell him that I find his comment as refreshing as a shower in lavender for it cures me almost if not fully of my old old habit of taking myself too seriously and writing as if I am meant to change the world and also that I will be very watchful about not enforcing any pauses through commas and under no circumstances on pain of ostracism for that worst of all effects namely dramatic effect and will assiduously follow the near zero comma if not a zero comma rule and that I would greatly value a meet up and a chat discussing pernicious punctuation and other evils.

It is for very similar reasons that I can’t wait for my copy of Solar Bones to be delivered.

Featured image: An extratropical cyclone over the US midwest, shaped like a comma. Credit: gsfc/Flickr, CC BY 2.0.

An experiment in propositional calculus

Q: Are truths simply objective reasons whose truth-values may or may not be verifiable?

A:

This question seems to possess a native paradox, but that simply arises from a logical error in the semantics: we can’t address unverifiable statements as “truths”. Instead, they are logically contingent statements.

Even so: As Wittgenstein says in the preface of his Tractatus Logico-Philosophicus, “In order to draw a limit of thinking, we should have to think both sides of this limit.” Similarly, in order to establish the objectivity of a statement, its subjectivity must be conclusively denied as well as its independence of subjective considerations verified.

The attainment of these conditions can be explored through Sir Ayer’s verification principle, the tenets of which were established in his 1926 opus, Language, Truth and Logic. However, it must be noted that Ayer denied, reasonably, that unempirical hypotheses may be formed on the basis of empirical engagements with reality. By extension, there exists an inherent denial of any transcendent reality, which in turn eliminates the presence of any objective truths.

At the same time, however, there exist objective literal truths, which are closer to being tautologies than truths themselves simply because they are a repetition of meaning whose propositional variables are actually fixed and whose truth-value is also fixed.

During an argument, negation and affirmation are used to establish the value of a propositional formula. The formula could be any statement whose propositional variables can assume different values. For instance, the statement S has an unverified propositional value.

S: Smoking is disagreeable; drinking is agreeable.

To some, S will make sense while, to some others, S won’t make any sense at all. In order to establish the truth-value of S, we explore the existence of a logical system that is consistent with the value of S being both true and false. This is unlikely because it contradicts our logical framework itself. Then, the next step is to understand the structure of a logical system in which S is either true or false and such that the value of one propositional variable impacts the value of the second propositional variable directly.

In other words, we make S a formula with two variables, X and Y, and find out how the values of X and Y are consistent/inconsistent with each other while they exist in the framework of the same set of logical principles.

S: X • Y

If we now hypothesize that X cannot retain its value while Y’s value is held fixed, then we pursue the negation of this hypothesis in order to establish that S is true. If we affirm the hypothesis, then we will prove that S is false. In the course of either of these arguments, we repeatedly hypothesize and evaluate the truth-value of each, and proceed until we have with a hypothesis that corroborates or denies the parent hypothesis and so renders the statement as either true or false.

However, if a rhetorical tautology cannot be assumed to constitute a reason (because it is a repetition of meaning), and if Wittgenstein’s proposition that tautologies are statements deducible logically and therefore meaningless is true, then the tenets of propositional logic are neither tautologies nor analytic truths.

Moreover, no literal significance can be assigned to logically valid statements according to Sir Ayer! In this context, the existence of any literal significance of logically valid statements depends not on their analytic proposition but their synthetic proposition – as affirmed by Sir Ayer. (Here, according to George Berkeley: “esse est percipi”!)