1. A relatively recent (past ~20k years) migration from Central Siberia correlated with the Ancestral North Eurasians [1], who contributed significant ancestry to Amerindians, Europeans, and Central/South Asians. They were phenotypically intermediate between modern East and West Eurasians, hence the unique combination of features often found in Amerindians.
2. A remnant of a much earlier (~50k years) population descended from humans who took the Southern Route [2] across Eurasia. They contributed significant ancestry to the Australian Aboriginals, certain South and Southeast Asian populations, and potentially some groups in the Amazon. The ancestry contributed to those Amerindians in the Amazon would've had to come from this population coming up across East Eurasia, where they could've left behind (or contributed to) populations like the Ainu.
West Eurasians (Caucasoids) and South Eurasians (Australoids) share a few distinctive traits that are shared by the Ainu, notably prominent brow ridges, lack of epicanthic folds, and heavier facial hair. So purely from a phenotypic point of view it's difficult to determine their origin. Genomic analyses also tend to be inconclusive, with Ainu often clustering with other Siberian groups rather than some special outgroup.