The love affair between dogs and people is an old one indeed, stretching back at least 15,000 years. Dogs are our coworkers, guides, companions, and family members. But how did they get that way? A paper published in Scientific Reports proposes an intriguing possibility: dogs have a genetic predisposition to crave human companionship.

Previous studies have suggested a genetic component to the domestication of dogs. To further test that hypothesis, five researchers from Linköping University in Sweden assembled an enormous group of 437 laboratory-raised beagles and gave each one an impossible test. Each dog was brought to a room containing a box with three dishes, and each dish held a treat. To get the treat, the beagle needed to figure out how to slide the cover off the container. But there was a catch: one of the containers was covered with transparent Plexiglas and would not yield its treat no matter what the confused beagle did.

The dog was not alone in the testing room; each was accompanied by a seated researcher, who looked away while the dog wrestled with the puzzle box. The real test came when each dog realized it could not retrieve the last treat. At this point, some dogs gave up and started walking around the room. But others—many others—looked to or approached the researcher for help, a behavior that demonstrated their interest in people.

Each dog’s test was videotaped and its reactions coded and quantified. The researchers then identified the 95 most sociable dogs and the 95 least sociable dogs, and sequenced their genomes, looking for trends.

They found them. The most sociable dogs showed activation in two highly specific genomic regions. The presence of a single marker on the 26th chromosome of the SEZ6L gene was a significant indication that a beagle would have spent more time near and physically touching the researcher during the test. Another two markers on chromosome 26 of the ARVCF gene were strongly associated with seeking out human contact.

These genomic regions are not unique to dogs and, the researchers say, their role in socialization may not be either. Studies in humans have found a relationship between changes in SEZ6L and autism. ARVCF has been linked to schizophrenia, as have COMT and TXNRD2, which both hail from the same genetic neighborhood.

“This is, to our knowledge, the first genome-wide study presenting candidate genomic regions for dog sociability and inter-species communication,” the authors write. They acknowledge that more research is needed to validate their findings. Still, they say, “these results contribute to a greater insight into the genetic basis of dog-human communicative behaviors and sociability, increasing our understanding of the domestication process, and could potentially aid knowledge relating to human social behavioral disorders.”