Saturday, May 28, 2016

What is syntax and how much does it matter?

From a computing point of view, when we say "syntax" we're largely talking about "parse trees".  A parse tree breaks a text into components, which are in turn broken down into sub-components, and so forth down to basic pieces analogous to words and punctuation in natural languages.  The largest unit is the root of the tree, and the tree branches wherever you break a larger component into smaller.  As I've said before, this is just like breaking a sentence down into, say, a noun phrase and a verb phrase, breaking the noun phrase into a determiner and a noun, and so forth.

I've also noted that this isn't the only way to break sentences down.  In fact, if you search for sentence diagramming, you're more likely to turn up material on the Reed-Kellog system, and there has been quite a bit of research on dependency grammars.  Both of these have tree structures implicit in them, but you could argue that pretty much any formal system does.  The more relevant point is that they don't emphasize constituency, that is, what's a part of what.  They're more interested in what modifies what, or more generally, what depends on what.

So, what is this syntax that we speak of?  I previously defined it as "the study of how words fit together in sentences".  Wikipedia has it as "the set of rules, principles, and processes that govern the structure of sentences in a given language, specifically word order", which seems pretty similar except for the emphasis on word order.  What sparked this post, however, was a statement in an Nat Geo blog post on killer whales (a.k.a. orcas, but that's a separate discussion), that
Language in the strict sense means syntax, which means that word placement determines meaning. So, “Put the blue pillow on the red pillow” means something different than, “Put the red pillow on the blue pillow.” Same exact words, different order. That’s language. Some dolphins and some apes have the ability to understand human syntax.
Killer whales are dolphins—the biggest ones. I am not aware of whether they understand human syntax. 
Initially I was struck by the simplicity of "word placement determines meaning" followed by a convincing example.  Later, I wondered how well that notion (or "specifically word order" in the Wikipedia definition) applies to languages with free word order.  Certainly order matters in narrating a story, or in figuring out which noun a pronoun might refer to, but in many languages ordering is more a matter of emphasis than meaning.

But now what strikes me about this passage is the emphasis on understanding.  This tends toward a more operational definition of syntax, for example, can you understand the difference between Put the blue pillow on the red pillow and Put the red pillow on the blue pillow.

Intuitively it seems like understanding the difference between Canis hominem mordet (dog bites man) and Canem homo mordet (man bites dog) would be much the same task, even though the word order is the same for both of those sentences.  So what are we really after here?

Fundamentally the problem to solve is communicating information reasonably efficiently and accurately.  I almost said "communicating concepts", but this depends on what concepts the parties involved can understand.  I may have a perfectly concise way to say "The square of the hypotenuse is equal to the sum of the squares of the legs", but that's not going to help much if my listener doesn't know what a hypotenuse is.

There's one other piece here, though.  Many species are capable of communicating a repertoire of messages, and even of learning new messages for that repertoire.  Vervets famously have different alarm calls for their main predators (leopards, eagles, pythons, and baboons).  They can also adjust to individuals that consistently make the wrong call, recognize their offspring by their calls and possibly invent new calls for new dangers.  Some dogs can be taught names for dozens of different objects which they can then retrieve by name.  Neither, however, seems to have language in the same way we do.

To establish that something unusual is going on, as with theories of mind, we need some sort of combinatorial explosion, that is, a situation in which a small number of basic pieces generate a very large number of possibilities.

For example, if we have a red pillow, a blue pillow, a red box and a blue box, and any one of them can be put to the left of, to the right of, in front of, behind, on top of or under any of the others, there 72 different combinations (red pillow to the left of blue pillow, red pillow to the left of red box ... blue box under red box), though since "red pillow to the left of blue pillow" is the same as "blue pillow to the right of red pillow" there are really only 36 possibilities, but 72 ways of expressing them.

The number of possibilities increases as the square of the number of objects.  If you double the number of objects, there are four times as many possibilities.  Similarly, if you add a new directional relation, say "to the left of and in front of", you've added as many possibilities as there are pairs of objects.  If you add a new kind of relation, say "close to" vs. "far from" (leaving aside whether you can place a red pillow far above a blue box), you've multiplied the total number of possibilities by a new factor.

For example, if you have ten objects, twelve directional relations and "touching", "close" and "far apart", you now have 1620 possibilities.  You haven't added much to the original setup, but there are now 45 times as many possibilities as before.  It's easy to see how you could make this much, much bigger just by adding more different kinds of distinctions.

Imagine an experiment where your subjects are (somehow) taught signs for the four objects and six directional relations, and then (somehow) required to communicate a particular arrangement.  Say subject 1 is shown an arrangement that subject 2 can't see, and if it can convince subject 2 to create the same arrangement they both get a reward.

If your test subjects can handle the original setup of 36 possibilities, it's possible that they learned the examples you gave by rote and guessed on ones they hadn't already seen.  You could control for that by making sure the two subjects are shown different examples, but if you want to run several trials and there are only 36 possibilities to choose from, it's hard to be sure that any significant syntax is involved.

On the other hand, suppose you have a pair of subjects that can handle the small setup, and then you add a new object.  After they see a couple of examples involving the new object they can handle unfamiliar setups involving it about as well as they can handle the originals.  You then give a few examples of a new relation (say, diagonal as above) and their performance doesn't suffer.  You then show a new kind of relation (say, distance as above) and they can still handle it.  You've now got a reasonably large space of arrangements to choose from and you can easily do repeated trials without repeating the exact arrangements.

At that point, I'd say you can infer that the communication system has some way not only of distinguishing "red pillow on top of blue pillow" from "blue pillow on top of red pillow", but distinguishing "A on top of B" from "B on top of A" in general.  I'll claim that at that point you can reasonably say there is syntax in some form, as well as some form of "abstract relation".


This is not the same as saying the experimental subjects have the same kind of language as we do.  You can solve the problem in the experiment with any way of selecting an directional relation, a first object, a second object and an distance relation.  That could be as simple as listing the four in order, as "red-pillow blue-pillow in-front-of close".

Handling new kinds of relations or constraints (e.g., put the pillow fuzzy side up) doesn't require much more syntax.  If the system can distinguish one relation/constraint from another, then something like "direction: red-pillow in-front-of blue-pillow, distance: close, orientation: red-pillow fuzzy-side-up" packs in a lot of information, and it's easy to see how you would extend it.


Where does that leave constructs that we tend to think are unique to human language, including dependent clauses like that I saw yesterday in The movie that I saw yesterday was two hours long?  I'm not sure how to set up an experiment like the previous one that could distinguish a language with dependent clauses from one without.  After all, I could just as well say I saw a movie yesterday.   That movie was two hours long.  This requires using that in its sense as a determiner to link the sentences together in a particular way.  This is still a pretty powerful construct, but it doesn't require tucking I saw the movie yesterday in as a direct modifier to movie.

From this point of view, the distinction between having dependent clauses and not having them is not particularly important.  This is in contrast to the computer science-y view that I've been most familiar with, where there is a huge distinction between recursive structures -- ones that can contain sub-parts of the same general form as the structure they're part of, such as sentences acting as clauses inside larger sentences -- and non-recursive structures, which can't.  One important distinction from that point of view is that there are in principle infinitely many possible structures -- sentences, say -- if recursion is allowed but only finitely many if it's not.

This is true in the mathematical world, but it's less important when considering real communication.  On the one hand, there are only finitely many sentences that are short enough for a real person to say or understand.  In practice, we rarely nest more than a few levels deep.  When we do, the result is often pretty hard to understand.

On the other hand, "finite" as a mathematical concept includes numbers large enough to be infinite for any practical purpose.  In fact, I've argued, almost all numbers are vastly too big for us to comprehend, let alone to occur in any natural context.  In practice, this means that even if you have only a handful of template sentences to fill in and you can't nest sentences within sentences, you can still end up with a gargantuan number of possible sentences -- and there's no reason you can't use more than one sentence in a conversation (technically, stringing sentences together can be expressed as recursion, but let's not get into that).



What if you can't do a controlled experiment to figure out how complex a communication system is?  What if all the data you have is from observations in the wild?  What if you're not sure what part of the noises, gestures or whatever else you observe are or aren't significant?  The task is certainly harder, then, but maybe not infeasible.  You're still looking for signs of combinatorial explosion, particularly the ability to deal with novel combinations of factors in a way that requires communication, that is, where
  • Different individuals have different information,
  • they need to share that information,
  • the exact information to share varies within a combinatorially large space of possibilities, and
  • the individuals involved are able to act usefully in ways they couldn't have without sharing the information.
The first two and the last are easy to find in any number of situations (arguably the second and last points are just different ways to say the same thing).  When a vervet sees a baboon, it shrieks out the alarm call for baboons and all the vervets skedaddle, you've met all but the third point.  From observation, it's reasonably clear that there isn't a combinatorially large space of possibilities.  There is a relatively small and constant set of calls.

Human communication clearly satisfies all four points.  Most of the sentences in this post, for example, are not only unique to the post but most likely unique to all human communication (I'm going to guess that the phrase "vervets skedaddle" is fairly rare in its own right -- it didn't turn up when I googled it with quotes, though that should soon change ...).  This is not something I consciously aimed for, just a natural consequence of writing reasonably long sentences in English (or any other natural language for that matter).

The interesting question is whether anyone else meets the third point.